{"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\n", "theoremStatement": "theorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a ", "theoremName": "HTPI.Exercises.dvd_a_of_dvd_b_mod", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1905, "tokenPositionInFile": 62474, "theoremPositionInFile": 166}, "dependencyMetadata": {"inFilePremises": false, "numInFilePremises": 0, "repositoryPremises": false, "numRepositoryPremises": 0, "numPremises": 8, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\n", "theoremStatement": "lemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a ", "theoremName": "HTPI.Exercises.gcd_comm_lt", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1909, "tokenPositionInFile": 62575, "theoremPositionInFile": 167}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 7, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\n", "theoremStatement": "theorem gcd_comm (a b : Nat) : gcd a b = gcd b a ", "theoremName": "HTPI.Exercises.gcd_comm", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1911, "tokenPositionInFile": 62647, "theoremPositionInFile": 168}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 5, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\n", "theoremStatement": "theorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n ", "theoremName": "HTPI.Exercises.Exercise_7_1_5", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "7e40747", "date": "2023-09-13"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1914, "tokenPositionInFile": 62712, "theoremPositionInFile": 169}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 18, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\n", "theoremStatement": "theorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b ", "theoremName": "HTPI.Exercises.Exercise_7_1_6", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "6b2542f", "date": "2023-04-08"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1918, "tokenPositionInFile": 62839, "theoremPositionInFile": 170}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 11, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\n", "theoremStatement": "theorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 ", "theoremName": "HTPI.Exercises.gcd_is_nonzero", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "68d6f9e", "date": "2023-04-28"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1922, "tokenPositionInFile": 62926, "theoremPositionInFile": 171}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 8, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\n", "theoremStatement": "theorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b ", "theoremName": "HTPI.Exercises.gcd_greatest", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "6b2542f", "date": "2023-04-08"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1926, "tokenPositionInFile": 63015, "theoremPositionInFile": 172}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 11, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\n", "theoremStatement": "lemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) ", "theoremName": "HTPI.Exercises.Lemma_7_1_10a", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "59c90ca", "date": "2023-09-12"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1930, "tokenPositionInFile": 63129, "theoremPositionInFile": 173}, "dependencyMetadata": {"inFilePremises": false, "numInFilePremises": 0, "repositoryPremises": false, "numRepositoryPremises": 0, "numPremises": 8, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\n", "theoremStatement": "lemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b ", "theoremName": "HTPI.Exercises.Lemma_7_1_10b", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "59c90ca", "date": "2023-09-12"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1933, "tokenPositionInFile": 63217, "theoremPositionInFile": 174}, "dependencyMetadata": {"inFilePremises": false, "numInFilePremises": 0, "repositoryPremises": false, "numRepositoryPremises": 0, "numPremises": 11, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\n", "theoremStatement": "lemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b ", "theoremName": "HTPI.Exercises.Lemma_7_1_10c", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "59c90ca", "date": "2023-09-12"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1936, "tokenPositionInFile": 63311, "theoremPositionInFile": 175}, "dependencyMetadata": {"inFilePremises": false, "numInFilePremises": 0, "repositoryPremises": false, "numRepositoryPremises": 0, "numPremises": 6, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\n", "theoremStatement": "theorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b ", "theoremName": "HTPI.Exercises.Exercise_7_1_10", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "6b2542f", "date": "2023-04-08"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1939, "tokenPositionInFile": 63391, "theoremPositionInFile": 176}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 8, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\n", "theoremStatement": "lemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p ", "theoremName": "HTPI.Exercises.dvd_prime", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1944, "tokenPositionInFile": 63503, "theoremPositionInFile": 177}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 10, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\n", "theoremStatement": "theorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 ", "theoremName": "HTPI.Exercises.prod_nonzero_nonzero", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "25681a1", "date": "2023-11-10"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1949, "tokenPositionInFile": 63666, "theoremPositionInFile": 178}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 10, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\n", "theoremStatement": "theorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b ", "theoremName": "HTPI.Exercises.rel_prime_iff_no_common_factor", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "68d6f9e", "date": "2023-04-28"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1953, "tokenPositionInFile": 63765, "theoremPositionInFile": 179}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 11, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\n", "theoremStatement": "theorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a ", "theoremName": "HTPI.Exercises.rel_prime_symm", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "fe2721d", "date": "2023-05-10"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1957, "tokenPositionInFile": 63892, "theoremPositionInFile": 180}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 4, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\n", "theoremStatement": "lemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a ", "theoremName": "HTPI.Exercises.in_prime_factorization_iff_prime_factor", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "ed81107", "date": "2023-09-14"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1961, "tokenPositionInFile": 63983, "theoremPositionInFile": 181}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 9, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\n", "theoremStatement": "theorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) ", "theoremName": "HTPI.Exercises.Exercise_7_2_5", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "68d6f9e", "date": "2023-04-28"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1966, "tokenPositionInFile": 64146, "theoremPositionInFile": 182}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 12, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\n", "theoremStatement": "theorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 ", "theoremName": "HTPI.Exercises.Exercise_7_2_6", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "6b2542f", "date": "2023-04-08"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1971, "tokenPositionInFile": 64332, "theoremPositionInFile": 183}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 18, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\n", "theoremStatement": "theorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' ", "theoremName": "HTPI.Exercises.Exercise_7_2_7", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "6b2542f", "date": "2023-04-08"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1975, "tokenPositionInFile": 64438, "theoremPositionInFile": 184}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 6, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\n", "theoremStatement": "theorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k ", "theoremName": "HTPI.Exercises.Exercise_7_2_9", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "ed6a4d7", "date": "2023-09-15"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1980, "tokenPositionInFile": 64570, "theoremPositionInFile": 185}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 12, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\n", "theoremStatement": "theorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c ", "theoremName": "HTPI.Exercises.Exercise_7_2_17a", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "6b2542f", "date": "2023-04-08"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1985, "tokenPositionInFile": 64715, "theoremPositionInFile": 186}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 9, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\n", "theoremStatement": "theorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) ", "theoremName": "HTPI.Exercises.congr_trans", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "fe2721d", "date": "2023-05-10"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1990, "tokenPositionInFile": 64828, "theoremPositionInFile": 187}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 5, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\n", "theoremStatement": "theorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X ", "theoremName": "HTPI.Exercises.Theorem_7_3_6_3", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1994, "tokenPositionInFile": 64943, "theoremPositionInFile": 188}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 18, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\n", "theoremStatement": "theorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m ", "theoremName": "HTPI.Exercises.Theorem_7_3_6_4", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 1997, "tokenPositionInFile": 65022, "theoremPositionInFile": 189}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 19, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\n", "theoremStatement": "theorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 ", "theoremName": "HTPI.Exercises.Exercise_7_3_4a", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "515de92", "date": "2023-04-13"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2001, "tokenPositionInFile": 65121, "theoremPositionInFile": 190}, "dependencyMetadata": {"inFilePremises": false, "numInFilePremises": 0, "repositoryPremises": false, "numRepositoryPremises": 0, "numPremises": 14, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\n", "theoremStatement": "theorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 ", "theoremName": "HTPI.Exercises.Exercise_7_3_4b", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2006, "tokenPositionInFile": 65274, "theoremPositionInFile": 191}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 18, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\n", "theoremStatement": "theorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) ", "theoremName": "HTPI.Exercises.Theorem_7_3_10", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "a2a51e2", "date": "2023-09-25"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2010, "tokenPositionInFile": 65401, "theoremPositionInFile": 192}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 15, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\n", "theoremStatement": "theorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) ", "theoremName": "HTPI.Exercises.Theorem_7_3_11", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2014, "tokenPositionInFile": 65526, "theoremPositionInFile": 193}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 15, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\n", "theoremStatement": "theorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) ", "theoremName": "HTPI.Exercises.Exercise_7_3_16", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2018, "tokenPositionInFile": 65650, "theoremPositionInFile": 194}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 7, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\n", "theoremStatement": "theorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b ", "theoremName": "HTPI.Exercises.congr_rel_prime", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "54b1fe6", "date": "2023-06-29"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2026, "tokenPositionInFile": 65878, "theoremPositionInFile": 195}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 9, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\n", "theoremStatement": "theorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a ", "theoremName": "HTPI.Exercises.rel_prime_mod", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "54b1fe6", "date": "2023-06-29"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2031, "tokenPositionInFile": 66051, "theoremPositionInFile": 196}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 8, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\n", "theoremStatement": "lemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m ", "theoremName": "HTPI.Exercises.congr_iff_mod_eq_Int", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "28aefa3", "date": "2023-08-06"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2035, "tokenPositionInFile": 66144, "theoremPositionInFile": 197}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 15, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\n", "theoremStatement": "theorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m ", "theoremName": "HTPI.Exercises.congr_iff_mod_eq_Nat", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "28aefa3", "date": "2023-08-06"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2040, "tokenPositionInFile": 66365, "theoremPositionInFile": 198}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 15, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\n", "theoremStatement": "lemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m ", "theoremName": "HTPI.Exercises.Exercise_7_4_5_Int", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "fe2721d", "date": "2023-05-10"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2049, "tokenPositionInFile": 66663, "theoremPositionInFile": 199}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 16, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\n", "theoremStatement": "lemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g ", "theoremName": "HTPI.Exercises.left_inv_one_one_below", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "a690ad4", "date": "2023-04-16"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2053, "tokenPositionInFile": 66765, "theoremPositionInFile": 200}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 7, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\n", "theoremStatement": "lemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) ", "theoremName": "HTPI.Exercises.comp_perm_below", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "68d6f9e", "date": "2023-04-28"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2057, "tokenPositionInFile": 66892, "theoremPositionInFile": 201}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 5, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\n", "theoremStatement": "lemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g ", "theoremName": "HTPI.Exercises.perm_below_fixed", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "a690ad4", "date": "2023-04-16"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2062, "tokenPositionInFile": 67033, "theoremPositionInFile": 202}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 10, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\n", "theoremStatement": "lemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c ", "theoremName": "HTPI.Exercises.Lemma_7_4_6", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "68d6f9e", "date": "2023-04-28"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2066, "tokenPositionInFile": 67162, "theoremPositionInFile": 203}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 9, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\nlemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c := sorry\n\n-- 6.\nexample {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n a ^ (phi m + 1) \u2261 a (MOD m) := sorry\n\n-- 7.\n", "theoremStatement": "theorem Like_Exercise_7_4_11 {m a p : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p + 1 = phi m) :\n [a]_m * [a ^ p]_m = [1]_m ", "theoremName": "HTPI.Exercises.Like_Exercise_7_4_11", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2074, "tokenPositionInFile": 67370, "theoremPositionInFile": 204}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 3, "repositoryPremises": true, "numRepositoryPremises": 3, "numPremises": 29, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\nlemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c := sorry\n\n-- 6.\nexample {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n a ^ (phi m + 1) \u2261 a (MOD m) := sorry\n\n-- 7.\ntheorem Like_Exercise_7_4_11 {m a p : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p + 1 = phi m) :\n [a]_m * [a ^ p]_m = [1]_m := sorry\n\n-- 8.\n", "theoremStatement": "theorem Like_Exercise_7_4_12 {m a p q k : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p = q + (phi m) * k) :\n a ^ p \u2261 a ^ q (MOD m) ", "theoremName": "HTPI.Exercises.Like_Exercise_7_4_12", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2079, "tokenPositionInFile": 67518, "theoremPositionInFile": 205}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 3, "repositoryPremises": true, "numRepositoryPremises": 3, "numPremises": 21, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\nlemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c := sorry\n\n-- 6.\nexample {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n a ^ (phi m + 1) \u2261 a (MOD m) := sorry\n\n-- 7.\ntheorem Like_Exercise_7_4_11 {m a p : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p + 1 = phi m) :\n [a]_m * [a ^ p]_m = [1]_m := sorry\n\n-- 8.\ntheorem Like_Exercise_7_4_12 {m a p q k : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p = q + (phi m) * k) :\n a ^ p \u2261 a ^ q (MOD m) := sorry\n\n/- Section 7.5 -/\n-- 1.\n--Hint: Use induction.\n", "theoremStatement": "lemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k ", "theoremName": "HTPI.Exercises.num_rp_prime", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "25681a1", "date": "2023-11-10"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2086, "tokenPositionInFile": 67714, "theoremPositionInFile": 206}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 13, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\nlemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c := sorry\n\n-- 6.\nexample {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n a ^ (phi m + 1) \u2261 a (MOD m) := sorry\n\n-- 7.\ntheorem Like_Exercise_7_4_11 {m a p : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p + 1 = phi m) :\n [a]_m * [a ^ p]_m = [1]_m := sorry\n\n-- 8.\ntheorem Like_Exercise_7_4_12 {m a p q k : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p = q + (phi m) * k) :\n a ^ p \u2261 a ^ q (MOD m) := sorry\n\n/- Section 7.5 -/\n-- 1.\n--Hint: Use induction.\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\n-- 2.\n", "theoremStatement": "lemma three_prime : prime 3 ", "theoremName": "HTPI.Exercises.three_prime", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "fe2721d", "date": "2023-05-10"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2090, "tokenPositionInFile": 67816, "theoremPositionInFile": 207}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 6, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\nlemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c := sorry\n\n-- 6.\nexample {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n a ^ (phi m + 1) \u2261 a (MOD m) := sorry\n\n-- 7.\ntheorem Like_Exercise_7_4_11 {m a p : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p + 1 = phi m) :\n [a]_m * [a ^ p]_m = [1]_m := sorry\n\n-- 8.\ntheorem Like_Exercise_7_4_12 {m a p q k : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p = q + (phi m) * k) :\n a ^ p \u2261 a ^ q (MOD m) := sorry\n\n/- Section 7.5 -/\n-- 1.\n--Hint: Use induction.\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\n-- 2.\nlemma three_prime : prime 3 := sorry\n\n-- 3.\n--Hint: Use the previous exercise, Exercise_7_2_7, and Theorem_7_4_2.\n", "theoremStatement": "theorem Exercise_7_5_13a (a : Nat) (h1 : rel_prime 561 a) :\n a ^ 560 \u2261 1 (MOD 3) ", "theoremName": "HTPI.Exercises.Exercise_7_5_13a", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "fc48d15", "date": "2023-12-02"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2094, "tokenPositionInFile": 67931, "theoremPositionInFile": 208}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 15, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\nlemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c := sorry\n\n-- 6.\nexample {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n a ^ (phi m + 1) \u2261 a (MOD m) := sorry\n\n-- 7.\ntheorem Like_Exercise_7_4_11 {m a p : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p + 1 = phi m) :\n [a]_m * [a ^ p]_m = [1]_m := sorry\n\n-- 8.\ntheorem Like_Exercise_7_4_12 {m a p q k : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p = q + (phi m) * k) :\n a ^ p \u2261 a ^ q (MOD m) := sorry\n\n/- Section 7.5 -/\n-- 1.\n--Hint: Use induction.\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\n-- 2.\nlemma three_prime : prime 3 := sorry\n\n-- 3.\n--Hint: Use the previous exercise, Exercise_7_2_7, and Theorem_7_4_2.\ntheorem Exercise_7_5_13a (a : Nat) (h1 : rel_prime 561 a) :\n a ^ 560 \u2261 1 (MOD 3) := sorry\n\n-- 4.\n--Hint: Imitate the way Theorem_7_2_2_Int was proven from Theorem_7_2_2.\n", "theoremStatement": "lemma Theorem_7_2_3_Int {p : Nat} {a b : Int}\n (h1 : prime p) (h2 : \u2191p \u2223 a * b) : \u2191p \u2223 a \u2228 \u2191p \u2223 b ", "theoremName": "HTPI.Exercises.Theorem_7_2_3_Int", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "fe2721d", "date": "2023-05-10"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2099, "tokenPositionInFile": 68105, "theoremPositionInFile": 209}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 1, "repositoryPremises": true, "numRepositoryPremises": 1, "numPremises": 13, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}} {"srcContext": "/- Copyright 2023 Daniel J. Velleman -/\n\nimport HTPILib.Chap6\nnamespace HTPI\n\n/- Definitions -/\nlemma mod_succ_lt (a n : Nat) : a % (n + 1) < n + 1 := by\n have h : n + 1 > 0 := Nat.succ_pos n\n show a % (n + 1) < n + 1 from Nat.mod_lt a h\n done\n\ndef gcd (a b : Nat) : Nat :=\n match b with\n | 0 => a\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd (n + 1) (a % (n + 1))\n termination_by b\n\nmutual\n def gcd_c1 (a b : Nat) : Int :=\n match b with\n | 0 => 1\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c2 (n + 1) (a % (n + 1))\n --Corresponds to s = t'\n termination_by b\n\n def gcd_c2 (a b : Nat) : Int :=\n match b with\n | 0 => 0\n | n + 1 =>\n have : a % (n + 1) < n + 1 := mod_succ_lt a n\n gcd_c1 (n + 1) (a % (n + 1)) -\n (gcd_c2 (n + 1) (a % (n + 1))) * \u2191(a / (n + 1))\n --Corresponds to t = s' - t'q\n termination_by b\nend\n\ndef prime (n : Nat) : Prop :=\n 2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n\n\ndef prime_factor (p n : Nat) : Prop := prime p \u2227 p \u2223 n\n\ndef all_prime (l : List Nat) : Prop := \u2200 p \u2208 l, prime p\n\ndef nondec (l : List Nat) : Prop :=\n match l with\n | [] => True --Of course, True is a proposition that is always true\n | n :: L => (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L\n\ndef nondec_prime_list (l : List Nat) : Prop := all_prime l \u2227 nondec l\n\ndef prod (l : List Nat) : Nat :=\n match l with\n | [] => 1\n | n :: L => n * (prod L)\n\ndef prime_factorization (n : Nat) (l : List Nat) : Prop :=\n nondec_prime_list l \u2227 prod l = n\n\ndef rel_prime (a b : Nat) : Prop := gcd a b = 1\n\ndef congr_mod (m : Nat) (a b : Int) : Prop := (\u2191m : Int) \u2223 (a - b)\n\ndef cc (m : Nat) (a : Int) : ZMod m := (\u2191a : ZMod m)\n\nnotation:50 a \" \u2261 \" b \" (MOD \" m \")\" => congr_mod m a b\n\nnotation:max \"[\"a\"]_\"m:max => cc m a\n\ndef invertible {m : Nat} (X : ZMod m) : Prop :=\n \u2203 (Y : ZMod m), X * Y = [1]_m\n\ndef num_rp_below (m k : Nat) : Nat :=\n match k with\n | 0 => 0\n | j + 1 => if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j\n\ndef phi (m : Nat) : Nat := num_rp_below m m\n\ndef prod_seq {m : Nat}\n (j k : Nat) (f : Nat \u2192 ZMod m) : ZMod m :=\n match j with\n | 0 => [1]_m\n | n + 1 => prod_seq n k f * f (k + n)\n\ndef maps_below (n : Nat) (g : Nat \u2192 Nat) : Prop := \u2200 i < n, g i < n\n\ndef one_one_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 i1 < n, \u2200 i2 < n, g i1 = g i2 \u2192 i1 = i2\n\ndef onto_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n \u2200 k < n, \u2203 i < n, g i = k\n\ndef perm_below (n : Nat) (g : Nat \u2192 Nat) : Prop :=\n maps_below n g \u2227 one_one_below n g \u2227 onto_below n g\n\ndef inv_mod (m a : Nat) : Nat := Int.toNat ((gcd_c2 m a) % m)\n\ndef swap (u v i : Nat) : Nat :=\n if i = u then v else if i = v then u else i\n\nnamespace Euler --For definitions specific to Euler's theorem\n\ndef F (m i : Nat) : ZMod m := if gcd m i = 1 then [i]_m else [1]_m\n\ndef G (m a i : Nat) : Nat := (a * i) % m\n\ndef Ginv (m a i : Nat) : Nat := G m (inv_mod m a) i\n\nend Euler\n\n/- Section 7.1 -/\ntheorem dvd_mod_of_dvd_a_b {a b d : Nat}\n (h1 : d \u2223 a) (h2 : d \u2223 b) : d \u2223 (a % b) := by\n set q : Nat := a / b\n have h3 : b * q + a % b = a := Nat.div_add_mod a b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n define --Goal : \u2203 (c : Nat), a % b = d * c\n apply Exists.intro (j - k * q)\n show a % b = d * (j - k * q) from\n calc a % b\n _ = b * q + a % b - b * q := (Nat.add_sub_cancel_left _ _).symm\n _ = a - b * q := by rw [h3]\n _ = d * j - d * (k * q) := by rw [h4, h5, mul_assoc]\n _ = d * (j - k * q) := (Nat.mul_sub_left_distrib _ _ _).symm\n done\n\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n#eval gcd 672 161 --Answer: 7\n\nlemma gcd_base (a : Nat) : gcd a 0 = a := by rfl\n\nlemma gcd_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd a b = gcd b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2] --Goal : gcd a (n + 1) = gcd (n + 1) (a % (n + 1))\n rfl\n done\n\nlemma mod_nonzero_lt (a : Nat) {b : Nat} (h : b \u2260 0) : a % b < b := by\n have h1 : b > 0 := Nat.pos_of_ne_zero h\n show a % b < b from Nat.mod_lt a h1\n done\n\nlemma dvd_self (n : Nat) : n \u2223 n := by\n apply Exists.intro 1\n ring\n done\n\ntheorem gcd_dvd : \u2200 (b a : Nat), (gcd a b) \u2223 a \u2227 (gcd a b) \u2223 b := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat), (gcd a b_1) \u2223 a \u2227 (gcd a b_1) \u2223 b_1\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_base] --Goal: a \u2223 a \u2227 a \u2223 0\n apply And.intro (dvd_self a)\n define\n apply Exists.intro 0\n rfl\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_nonzero a h1]\n --Goal : gcd b (a % b) \u2223 a \u2227 gcd b (a % b) \u2223 b\n have h2 : a % b < b := mod_nonzero_lt a h1\n have h3 : (gcd b (a % b)) \u2223 b \u2227 (gcd b (a % b)) \u2223 (a % b) :=\n ih (a % b) h2 b\n apply And.intro _ h3.left\n show (gcd b (a % b)) \u2223 a from dvd_a_of_dvd_b_mod h3.left h3.right\n done\n done\n\ntheorem gcd_dvd_left (a b : Nat) : (gcd a b) \u2223 a := (gcd_dvd b a).left\n\ntheorem gcd_dvd_right (a b : Nat) : (gcd a b) \u2223 b := (gcd_dvd b a).right\n\nlemma gcd_c1_base (a : Nat) : gcd_c1 a 0 = 1 := by rfl\n\nlemma gcd_c1_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c1 a b = gcd_c2 b (a % b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\nlemma gcd_c2_base (a : Nat) : gcd_c2 a 0 = 0 := by rfl\n\nlemma gcd_c2_nonzero (a : Nat) {b : Nat} (h : b \u2260 0) :\n gcd_c2 a b = gcd_c1 b (a % b) - (gcd_c2 b (a % b)) * \u2191(a / b) := by\n obtain (n : Nat) (h2 : b = n + 1) from exists_eq_add_one_of_ne_zero h\n rewrite [h2]\n rfl\n done\n\ntheorem gcd_lin_comb : \u2200 (b a : Nat),\n (gcd_c1 a b) * \u2191a + (gcd_c2 a b) * \u2191b = \u2191(gcd a b) := by\n by_strong_induc\n fix b : Nat\n assume ih : \u2200 b_1 < b, \u2200 (a : Nat),\n (gcd_c1 a b_1) * \u2191a + (gcd_c2 a b_1) * \u2191b_1 = \u2191(gcd a b_1)\n fix a : Nat\n by_cases h1 : b = 0\n \u00b7 -- Case 1. h1 : b = 0\n rewrite [h1, gcd_c1_base, gcd_c2_base, gcd_base]\n --Goal : 1 * \u2191a + 0 * \u21910 = \u2191a\n ring\n done\n \u00b7 -- Case 2. h1 : b \u2260 0\n rewrite [gcd_c1_nonzero a h1, gcd_c2_nonzero a h1, gcd_nonzero a h1]\n --Goal : gcd_c2 b (a % b) * \u2191a +\n -- (gcd_c1 b (a % b) - gcd_c2 b (a % b) * \u2191(a / b)) * \u2191b =\n -- \u2191(gcd b (a % b))\n set r : Nat := a % b\n set q : Nat := a / b\n set s : Int := gcd_c1 b r\n set t : Int := gcd_c2 b r\n --Goal : t * \u2191a + (s - t * \u2191q) * \u2191b = \u2191(gcd b r)\n have h2 : r < b := mod_nonzero_lt a h1\n have h3 : s * \u2191b + t * \u2191r = \u2191(gcd b r) := ih r h2 b\n have h4 : b * q + r = a := Nat.div_add_mod a b\n rewrite [\u2190h3, \u2190h4]\n rewrite [Nat.cast_add, Nat.cast_mul]\n --Goal : t * (\u2191b * \u2191q + \u2191r) + (s - t * \u2191q) * \u2191b = s * \u2191b + t * \u2191r\n ring\n done\n done\n\n#eval gcd_c1 672 161 --Answer: 6\n#eval gcd_c2 672 161 --Answer: -25\n --Note 6 * 672 - 25 * 161 = 4032 - 4025 = 7 = gcd 672 161\n\ntheorem Theorem_7_1_6 {d a b : Nat} (h1 : d \u2223 a) (h2 : d \u2223 b) :\n d \u2223 gcd a b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191d \u2223 \u2191(gcd a b)\n set s : Int := gcd_c1 a b\n set t : Int := gcd_c2 a b\n have h3 : s * \u2191a + t * \u2191b = \u2191(gcd a b) := gcd_lin_comb b a\n rewrite [\u2190h3] --Goal : \u2191d \u2223 s * \u2191a + t * \u2191b\n obtain (j : Nat) (h4 : a = d * j) from h1\n obtain (k : Nat) (h5 : b = d * k) from h2\n rewrite [h4, h5, Nat.cast_mul, Nat.cast_mul]\n --Goal : \u2191d \u2223 s * (\u2191d * \u2191j) + t * (\u2191d * \u2191k)\n define\n apply Exists.intro (s * \u2191j + t * \u2191k)\n ring\n done\n\n/- Section 7.2 -/\ntheorem dvd_trans {a b c : Nat} (h1 : a \u2223 b) (h2 : b \u2223 c) : a \u2223 c := by\n define at h1; define at h2; define\n obtain (m : Nat) (h3 : b = a * m) from h1\n obtain (n : Nat) (h4 : c = b * n) from h2\n rewrite [h3, mul_assoc] at h4\n apply Exists.intro (m * n)\n show c = a * (m * n) from h4\n done\n\nlemma exists_prime_factor : \u2200 (n : Nat), 2 \u2264 n \u2192\n \u2203 (p : Nat), prime_factor p n := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, 2 \u2264 n_1 \u2192 \u2203 (p : Nat), prime_factor p n_1\n assume h1 : 2 \u2264 n\n by_cases h2 : prime n\n \u00b7 -- Case 1. h2 : prime n\n apply Exists.intro n\n define --Goal : prime n \u2227 n \u2223 n\n show prime n \u2227 n \u2223 n from And.intro h2 (dvd_self n)\n done\n \u00b7 -- Case 2. h2 : \u00acprime n\n define at h2\n --h2 : \u00ac(2 \u2264 n \u2227 \u00ac\u2203 (a b : Nat), a * b = n \u2227 a < n \u2227 b < n)\n demorgan at h2\n disj_syll h2 h1\n obtain (a : Nat) (h3 : \u2203 (b : Nat), a * b = n \u2227 a < n \u2227 b < n) from h2\n obtain (b : Nat) (h4 : a * b = n \u2227 a < n \u2227 b < n) from h3\n have h5 : 2 \u2264 a := by\n by_contra h6\n have h7 : a \u2264 1 := by linarith\n have h8 : n \u2264 b :=\n calc n\n _ = a * b := h4.left.symm\n _ \u2264 1 * b := by rel [h7]\n _ = b := by ring\n linarith --n \u2264 b contradicts b < n\n done\n have h6 : \u2203 (p : Nat), prime_factor p a := ih a h4.right.left h5\n obtain (p : Nat) (h7 : prime_factor p a) from h6\n apply Exists.intro p\n define --Goal : prime p \u2227 p \u2223 n\n define at h7 --h7 : prime p \u2227 p \u2223 a\n apply And.intro h7.left\n have h8 : a \u2223 n := by\n apply Exists.intro b\n show n = a * b from (h4.left).symm\n done\n show p \u2223 n from dvd_trans h7.right h8\n done\n done\n\nlemma exists_least_prime_factor {n : Nat} (h : 2 \u2264 n) :\n \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := by\n set S : Set Nat := {p : Nat | prime_factor p n}\n have h2 : \u2203 (p : Nat), p \u2208 S := exists_prime_factor n h\n show \u2203 (p : Nat), prime_factor p n \u2227\n \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q from well_ord_princ S h2\n done\n\nlemma all_prime_nil : all_prime [] := by\n define --Goal : \u2200 p \u2208 [], prime p\n fix p : Nat\n contrapos --Goal : \u00acprime p \u2192 p \u2209 []\n assume h1 : \u00acprime p\n show p \u2209 [] from List.not_mem_nil p\n done\n\nlemma all_prime_cons (n : Nat) (L : List Nat) :\n all_prime (n :: L) \u2194 prime n \u2227 all_prime L := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : all_prime (n :: L) --Goal : prime n \u2227 all_prime L\n define at h1 --h1 : \u2200 p \u2208 n :: L, prime p\n apply And.intro (h1 n (List.mem_cons_self n L))\n define --Goal : \u2200 p \u2208 L, prime p\n fix p : Nat\n assume h2 : p \u2208 L\n show prime p from h1 p (List.mem_cons_of_mem n h2)\n done\n \u00b7 -- (\u2190)\n assume h1 : prime n \u2227 all_prime L --Goal : all_prime (n :: l)\n define : all_prime L at h1\n define\n fix p : Nat\n assume h2 : p \u2208 n :: L\n rewrite [List.mem_cons] at h2 --h2 : p = n \u2228 p \u2208 L\n by_cases on h2\n \u00b7 -- Case 1. h2 : p = n\n rewrite [h2]\n show prime n from h1.left\n done\n \u00b7 -- Case 2. h2 : p \u2208 L\n show prime p from h1.right p h2\n done\n done\n done\n\nlemma nondec_nil : nondec [] := by\n define --Goal : True\n trivial --trivial proves some obviously true statements, such as True\n done\n\nlemma nondec_cons (n : Nat) (L : List Nat) :\n nondec (n :: L) \u2194 (\u2200 m \u2208 L, n \u2264 m) \u2227 nondec L := by rfl\n\nlemma prod_nil : prod [] = 1 := by rfl\n\nlemma prod_cons : prod (n :: L) = n * (prod L) := by rfl\n\nlemma exists_cons_of_length_eq_succ {A : Type}\n {l : List A} {n : Nat} (h : l.length = n + 1) :\n \u2203 (a : A) (L : List A), l = a :: L \u2227 L.length = n := by\n have h1 : \u00acl.length = 0 := by linarith\n rewrite [List.length_eq_zero] at h1\n obtain (a : A) (h2 : \u2203 (L : List A), l = a :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List A) (h3 : l = a :: L) from h2\n apply Exists.intro a\n apply Exists.intro L\n apply And.intro h3\n have h4 : (a :: L).length = L.length + 1 := List.length_cons a L\n rewrite [\u2190h3, h] at h4\n show L.length = n from (Nat.add_right_cancel h4).symm\n done\n\nlemma list_elt_dvd_prod_by_length (a : Nat) : \u2200 (n : Nat),\n \u2200 (l : List Nat), l.length = n \u2192 a \u2208 l \u2192 a \u2223 prod l := by\n by_induc\n \u00b7 --Base Case\n fix l : List Nat\n assume h1 : l.length = 0\n rewrite [List.length_eq_zero] at h1 --h1 : l = []\n rewrite [h1] --Goal : a \u2208 [] \u2192 a \u2223 prod []\n contrapos\n assume h2 : \u00aca \u2223 prod []\n show a \u2209 [] from List.not_mem_nil a\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (l : List Nat), List.length l = n \u2192 a \u2208 l \u2192 a \u2223 prod l\n fix l : List Nat\n assume h1 : l.length = n + 1 --Goal : a \u2208 l \u2192 a \u2223 prod l\n obtain (b : Nat) (h2 : \u2203 (L : List Nat),\n l = b :: L \u2227 L.length = n) from exists_cons_of_length_eq_succ h1\n obtain (L : List Nat) (h3 : l = b :: L \u2227 L.length = n) from h2\n have h4 : a \u2208 L \u2192 a \u2223 prod L := ih L h3.right\n assume h5 : a \u2208 l\n rewrite [h3.left, prod_cons] --Goal : a \u2223 b * prod L\n rewrite [h3.left, List.mem_cons] at h5 --h5 : a = b \u2228 a \u2208 L\n by_cases on h5\n \u00b7 -- Case 1. h5 : a = b\n apply Exists.intro (prod L)\n rewrite [h5]\n rfl\n done\n \u00b7 -- Case 2. h5 : a \u2208 L\n have h6 : a \u2223 prod L := h4 h5\n have h7 : prod L \u2223 b * prod L := by\n apply Exists.intro b\n ring\n done\n show a \u2223 b * prod L from dvd_trans h6 h7\n done\n done\n done\n\nlemma list_elt_dvd_prod {a : Nat} {l : List Nat}\n (h : a \u2208 l) : a \u2223 prod l := by\n set n : Nat := l.length\n have h1 : l.length = n := by rfl\n show a \u2223 prod l from list_elt_dvd_prod_by_length a n l h1 h\n done\n\nlemma exists_prime_factorization : \u2200 (n : Nat), n \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n l := by\n by_strong_induc\n fix n : Nat\n assume ih : \u2200 n_1 < n, n_1 \u2265 1 \u2192\n \u2203 (l : List Nat), prime_factorization n_1 l\n assume h1 : n \u2265 1\n by_cases h2 : n = 1\n \u00b7 -- Case 1. h2 : n = 1\n apply Exists.intro []\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list []\n define\n show all_prime [] \u2227 nondec [] from\n And.intro all_prime_nil nondec_nil\n done\n \u00b7 -- Proof of prod [] = n\n rewrite [prod_nil, h2]\n rfl\n done\n done\n \u00b7 -- Case 2. h2 : n \u2260 1\n have h3 : n \u2265 2 := lt_of_le_of_ne' h1 h2\n obtain (p : Nat) (h4 : prime_factor p n \u2227 \u2200 (q : Nat),\n prime_factor q n \u2192 p \u2264 q) from exists_least_prime_factor h3\n have p_prime_factor : prime_factor p n := h4.left\n define at p_prime_factor\n have p_prime : prime p := p_prime_factor.left\n have p_dvd_n : p \u2223 n := p_prime_factor.right\n have p_least : \u2200 (q : Nat), prime_factor q n \u2192 p \u2264 q := h4.right\n obtain (m : Nat) (n_eq_pm : n = p * m) from p_dvd_n\n have h5 : m \u2260 0 := by\n contradict h1 with h6\n have h7 : n = 0 :=\n calc n\n _ = p * m := n_eq_pm\n _ = p * 0 := by rw [h6]\n _ = 0 := by ring\n rewrite [h7]\n decide\n done\n have m_pos : 0 < m := Nat.pos_of_ne_zero h5\n have m_lt_n : m < n := by\n define at p_prime\n show m < n from\n calc m\n _ < m + m := by linarith\n _ = 2 * m := by ring\n _ \u2264 p * m := by rel [p_prime.left]\n _ = n := n_eq_pm.symm\n done\n obtain (L : List Nat) (h6 : prime_factorization m L)\n from ih m m_lt_n m_pos\n define at h6\n have ndpl_L : nondec_prime_list L := h6.left\n define at ndpl_L\n apply Exists.intro (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of nondec_prime_list (p :: L)\n define\n apply And.intro\n \u00b7 -- Proof of all_prime (p :: L)\n rewrite [all_prime_cons]\n show prime p \u2227 all_prime L from And.intro p_prime ndpl_L.left\n done\n \u00b7 -- Proof of nondec (p :: L)\n rewrite [nondec_cons]\n apply And.intro _ ndpl_L.right\n fix q : Nat\n assume q_in_L : q \u2208 L\n have h7 : q \u2223 prod L := list_elt_dvd_prod q_in_L\n rewrite [h6.right] at h7 --h7 : q \u2223 m\n have h8 : m \u2223 n := by\n apply Exists.intro p\n rewrite [n_eq_pm]\n ring\n done\n have q_dvd_n : q \u2223 n := dvd_trans h7 h8\n have ap_L : all_prime L := ndpl_L.left\n define at ap_L\n have q_prime_factor : prime_factor q n :=\n And.intro (ap_L q q_in_L) q_dvd_n\n show p \u2264 q from p_least q q_prime_factor\n done\n done\n \u00b7 -- Proof of prod (p :: L) = n\n rewrite [prod_cons, h6.right, n_eq_pm]\n rfl\n done\n done\n done\n\ntheorem Theorem_7_2_2 {a b c : Nat}\n (h1 : c \u2223 a * b) (h2 : rel_prime a c) : c \u2223 b := by\n rewrite [\u2190Int.natCast_dvd_natCast] --Goal : \u2191c \u2223 \u2191b\n define at h1; define at h2; define\n obtain (j : Nat) (h3 : a * b = c * j) from h1\n set s : Int := gcd_c1 a c\n set t : Int := gcd_c2 a c\n have h4 : s * \u2191a + t * \u2191c = \u2191(gcd a c) := gcd_lin_comb c a\n rewrite [h2, Nat.cast_one] at h4 --h4 : s * \u2191a + t * \u2191c = (1 : Int)\n apply Exists.intro (s * \u2191j + t * \u2191b)\n show \u2191b = \u2191c * (s * \u2191j + t * \u2191b) from\n calc \u2191b\n _ = (1 : Int) * \u2191b := (one_mul _).symm\n _ = (s * \u2191a + t * \u2191c) * \u2191b := by rw [h4]\n _ = s * (\u2191a * \u2191b) + t * \u2191c * \u2191b := by ring\n _ = s * (\u2191c * \u2191j) + t * \u2191c * \u2191b := by\n rw [\u2190Nat.cast_mul a b, h3, Nat.cast_mul c j]\n _ = \u2191c * (s * \u2191j + t * \u2191b) := by ring\n done\n\nlemma le_nonzero_prod_left {a b : Nat} (h : a * b \u2260 0) : a \u2264 a * b := by\n have h1 : b \u2260 0 := by\n contradict h with h1\n rewrite [h1]\n ring\n done\n have h2 : 1 \u2264 b := Nat.pos_of_ne_zero h1\n show a \u2264 a * b from\n calc a\n = a * 1 := (mul_one a).symm\n _ \u2264 a * b := by rel [h2]\n done\n\nlemma le_nonzero_prod_right {a b : Nat} (h : a * b \u2260 0) : b \u2264 a * b := by\n rewrite [mul_comm]\n rewrite [mul_comm] at h\n show b \u2264 b * a from le_nonzero_prod_left h\n done\n\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\nlemma rel_prime_of_prime_not_dvd {a p : Nat}\n (h1 : prime p) (h2 : \u00acp \u2223 a) : rel_prime a p := by\n have h3 : gcd a p \u2223 a := gcd_dvd_left a p\n have h4 : gcd a p \u2223 p := gcd_dvd_right a p\n have h5 : gcd a p = 1 \u2228 gcd a p = p := dvd_prime h1 h4\n have h6 : gcd a p \u2260 p := by\n contradict h2 with h6\n rewrite [h6] at h3\n show p \u2223 a from h3\n done\n disj_syll h5 h6\n show rel_prime a p from h5\n done\n\ntheorem Theorem_7_2_3 {a b p : Nat}\n (h1 : prime p) (h2 : p \u2223 a * b) : p \u2223 a \u2228 p \u2223 b := by\n or_right with h3\n have h4 : rel_prime a p := rel_prime_of_prime_not_dvd h1 h3\n show p \u2223 b from Theorem_7_2_2 h2 h4\n done\n\nlemma ge_one_of_prod_one {a b : Nat} (h : a * b = 1) : a \u2265 1 := by\n have h1 : a \u2260 0 := by\n by_contra h1\n rewrite [h1] at h\n contradict h\n linarith\n done\n show a \u2265 1 from Nat.pos_of_ne_zero h1\n done\n\nlemma eq_one_of_prod_one {a b : Nat} (h : a * b = 1) : a = 1 := by\n have h1 : a \u2265 1 := ge_one_of_prod_one h\n have h2 : a * b \u2260 0 := by linarith\n have h3 : a \u2264 a * b := le_nonzero_prod_left h2\n rewrite [h] at h3\n show a = 1 from Nat.le_antisymm h3 h1\n done\n\nlemma eq_one_of_dvd_one {n : Nat} (h : n \u2223 1) : n = 1 := by\n obtain (j : Nat) (h1 : 1 = n * j) from h\n show n = 1 from eq_one_of_prod_one h1.symm\n done\n\nlemma prime_not_one {p : Nat} (h : prime p) : p \u2260 1 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_4 {p : Nat} (h1 : prime p) :\n \u2200 (l : List Nat), p \u2223 prod l \u2192 \u2203 a \u2208 l, p \u2223 a := by\n apply List.rec\n \u00b7 -- Base Case. Goal : p \u2223 prod [] \u2192 \u2203 a \u2208 [], p \u2223 a\n rewrite [prod_nil]\n assume h2 : p \u2223 1\n show \u2203 a \u2208 [], p \u2223 a from\n absurd (eq_one_of_dvd_one h2) (prime_not_one h1)\n done\n \u00b7 -- Induction Step\n fix b : Nat\n fix L : List Nat\n assume ih : p \u2223 prod L \u2192 \u2203 a \u2208 L, p \u2223 a\n --Goal : p \u2223 prod (b :: L) \u2192 \u2203 a \u2208 b :: L, p \u2223 a\n assume h2 : p \u2223 prod (b :: L)\n rewrite [prod_cons] at h2\n have h3 : p \u2223 b \u2228 p \u2223 prod L := Theorem_7_2_3 h1 h2\n by_cases on h3\n \u00b7 -- Case 1. h3 : p \u2223 b\n apply Exists.intro b\n show b \u2208 b :: L \u2227 p \u2223 b from\n And.intro (List.mem_cons_self b L) h3\n done\n \u00b7 -- Case 2. h3 : p \u2223 prod L\n obtain (a : Nat) (h4 : a \u2208 L \u2227 p \u2223 a) from ih h3\n apply Exists.intro a\n show a \u2208 b :: L \u2227 p \u2223 a from\n And.intro (List.mem_cons_of_mem b h4.left) h4.right\n done\n done\n done\n\nlemma prime_in_list {p : Nat} {l : List Nat}\n (h1 : prime p) (h2 : all_prime l) (h3 : p \u2223 prod l) : p \u2208 l := by\n obtain (a : Nat) (h4 : a \u2208 l \u2227 p \u2223 a) from Theorem_7_2_4 h1 l h3\n define at h2\n have h5 : prime a := h2 a h4.left\n have h6 : p = 1 \u2228 p = a := dvd_prime h5 h4.right\n disj_syll h6 (prime_not_one h1)\n rewrite [h6]\n show a \u2208 l from h4.left\n done\n\nlemma first_le_first {p q : Nat} {l m : List Nat}\n (h1 : nondec_prime_list (p :: l)) (h2 : nondec_prime_list (q :: m))\n (h3 : prod (p :: l) = prod (q :: m)) : p \u2264 q := by\n define at h1; define at h2\n have h4 : q \u2223 prod (p :: l) := by\n define\n apply Exists.intro (prod m)\n rewrite [\u2190prod_cons]\n show prod (p :: l) = prod (q :: m) from h3\n done\n have h5 : all_prime (q :: m) := h2.left\n rewrite [all_prime_cons] at h5\n have h6 : q \u2208 p :: l := prime_in_list h5.left h1.left h4\n have h7 : nondec (p :: l) := h1.right\n rewrite [nondec_cons] at h7\n rewrite [List.mem_cons] at h6\n by_cases on h6\n \u00b7 -- Case 1. h6 : q = p\n linarith\n done\n \u00b7 -- Case 2. h6 : q \u2208 l\n have h8 : \u2200 m \u2208 l, p \u2264 m := h7.left\n show p \u2264 q from h8 q h6\n done\n done\n\nlemma nondec_prime_list_tail {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : nondec_prime_list l := by\n define at h\n define\n rewrite [all_prime_cons, nondec_cons] at h\n show all_prime l \u2227 nondec l from And.intro h.left.right h.right.right\n done\n\nlemma cons_prod_not_one {p : Nat} {l : List Nat}\n (h : nondec_prime_list (p :: l)) : prod (p :: l) \u2260 1 := by\n define at h\n have h1 : all_prime (p :: l) := h.left\n rewrite [all_prime_cons] at h1\n rewrite [prod_cons]\n by_contra h2\n show False from (prime_not_one h1.left) (eq_one_of_prod_one h2)\n done\n\nlemma list_nil_iff_prod_one {l : List Nat} (h : nondec_prime_list l) :\n l = [] \u2194 prod l = 1 := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : l = []\n rewrite [h1]\n show prod [] = 1 from prod_nil\n done\n \u00b7 -- (\u2190)\n contrapos\n assume h1 : \u00acl = []\n obtain (p : Nat) (h2 : \u2203 (L : List Nat), l = p :: L) from\n List.exists_cons_of_ne_nil h1\n obtain (L : List Nat) (h3 : l = p :: L) from h2\n rewrite [h3] at h\n rewrite [h3]\n show \u00acprod (p :: L) = 1 from cons_prod_not_one h\n done\n done\n\nlemma prime_pos {p : Nat} (h : prime p) : p > 0 := by\n define at h\n linarith\n done\n\ntheorem Theorem_7_2_5 : \u2200 (l1 l2 : List Nat),\n nondec_prime_list l1 \u2192 nondec_prime_list l2 \u2192\n prod l1 = prod l2 \u2192 l1 = l2 := by\n apply List.rec\n \u00b7 -- Base Case. Goal : \u2200 (l2 : List Nat), nondec_prime_list [] \u2192\n -- nondec_prime_list l2 \u2192 prod [] = prod l2 \u2192 [] = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list []\n assume h2 : nondec_prime_list l2\n assume h3 : prod [] = prod l2\n rewrite [prod_nil, eq_comm, \u2190list_nil_iff_prod_one h2] at h3\n show [] = l2 from h3.symm\n done\n \u00b7 -- Induction Step\n fix p : Nat\n fix L1 : List Nat\n assume ih : \u2200 (L2 : List Nat), nondec_prime_list L1 \u2192\n nondec_prime_list L2 \u2192 prod L1 = prod L2 \u2192 L1 = L2\n -- Goal : \u2200 (l2 : List Nat), nondec_prime_list (p :: L1) \u2192\n -- nondec_prime_list l2 \u2192 prod (p :: L1) = prod l2 \u2192 p :: L1 = l2\n fix l2 : List Nat\n assume h1 : nondec_prime_list (p :: L1)\n assume h2 : nondec_prime_list l2\n assume h3 : prod (p :: L1) = prod l2\n have h4 : \u00acprod (p :: L1) = 1 := cons_prod_not_one h1\n rewrite [h3, \u2190list_nil_iff_prod_one h2] at h4\n obtain (q : Nat) (h5 : \u2203 (L : List Nat), l2 = q :: L) from\n List.exists_cons_of_ne_nil h4\n obtain (L2 : List Nat) (h6 : l2 = q :: L2) from h5\n rewrite [h6] at h2 --h2 : nondec_prime_list (q :: L2)\n rewrite [h6] at h3 --h3 : prod (p :: L1) = prod (q :: L2)\n have h7 : p \u2264 q := first_le_first h1 h2 h3\n have h8 : q \u2264 p := first_le_first h2 h1 h3.symm\n have h9 : p = q := by linarith\n rewrite [h9, prod_cons, prod_cons] at h3\n --h3 : q * prod L1 = q * prod L2\n have h10 : nondec_prime_list L1 := nondec_prime_list_tail h1\n have h11 : nondec_prime_list L2 := nondec_prime_list_tail h2\n define at h2\n have h12 : all_prime (q :: L2) := h2.left\n rewrite [all_prime_cons] at h12\n have h13 : q > 0 := prime_pos h12.left\n have h14 : prod L1 = prod L2 := Nat.eq_of_mul_eq_mul_left h13 h3\n have h15 : L1 = L2 := ih L2 h10 h11 h14\n rewrite [h6, h9, h15]\n rfl\n done\n done\n\ntheorem fund_thm_arith (n : Nat) (h : n \u2265 1) :\n \u2203! (l : List Nat), prime_factorization n l := by\n exists_unique\n \u00b7 -- Existence\n show \u2203 (l : List Nat), prime_factorization n l from\n exists_prime_factorization n h\n done\n \u00b7 -- Uniqueness\n fix l1 : List Nat; fix l2 : List Nat\n assume h1 : prime_factorization n l1\n assume h2 : prime_factorization n l2\n define at h1; define at h2\n have h3 : prod l1 = n := h1.right\n rewrite [\u2190h2.right] at h3\n show l1 = l2 from Theorem_7_2_5 l1 l2 h1.left h2.left h3\n done\n done\n\n/- Section 7.3 -/\ntheorem congr_refl (m : Nat) : \u2200 (a : Int), a \u2261 a (MOD m) := by\n fix a : Int\n define --Goal : \u2203 (c : Int), a - a = \u2191m * c\n apply Exists.intro 0\n ring\n done\n\ntheorem congr_symm {m : Nat} : \u2200 {a b : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 a (MOD m) := by\n fix a : Int; fix b : Int\n assume h1 : a \u2261 b (MOD m)\n define at h1 --h1 : \u2203 (c : Int), a - b = \u2191m * c\n define --Goal : \u2203 (c : Int), b - a = \u2191m * c\n obtain (c : Int) (h2 : a - b = m * c) from h1\n apply Exists.intro (-c)\n show b - a = m * (-c) from\n calc b - a\n _ = -(a - b) := by ring\n _ = -(m * c) := by rw [h2]\n _ = m * (-c) := by ring\n done\n\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n/- Fundamental properties of congruence classes -/\nlemma cc_eq_iff_val_eq {n : Nat} (X Y : ZMod (n + 1)) :\n X = Y \u2194 X.val = Y.val := Fin.ext_iff\n\nlemma val_nat_eq_mod (n k : Nat) :\n ([k]_(n + 1)).val = k % (n + 1) := by rfl\n\nlemma val_zero (n : Nat) : ([0]_(n + 1)).val = 0 := by rfl\n\ntheorem cc_rep {m : Nat} (X : ZMod m) : \u2203 (a : Int), X = [a]_m :=\n match m with\n | 0 => by\n apply Exists.intro X\n rfl\n done\n | n + 1 => by\n apply Exists.intro \u2191(X.val)\n have h1 : X.val < n + 1 := Fin.prop X\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, Nat.mod_eq_of_lt h1]\n rfl\n done\n\ntheorem add_class (m : Nat) (a b : Int) :\n [a]_m + [b]_m = [a + b]_m := (Int.cast_add a b).symm\n\ntheorem mul_class (m : Nat) (a b : Int) :\n [a]_m * [b]_m = [a * b]_m := (Int.cast_mul a b).symm\n\nlemma cc_eq_iff_sub_zero (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 [a - b]_m = [0]_m := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : [a]_m = [b]_m\n have h2 : a - b = a + (-b) := by ring\n have h3 : b + (-b) = 0 := by ring\n show [a - b]_m = [0]_m from\n calc [a - b]_m\n _ = [a + (-b)]_m := by rw [h2]\n _ = [a]_m + [-b]_m := by rw [add_class]\n _ = [b]_m + [-b]_m := by rw [h1]\n _ = [b + -b]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n \u00b7 -- (\u2190)\n assume h1 : [a - b]_m = [0]_m\n have h2 : b + (a - b) = a := by ring\n have h3 : b + 0 = b := by ring\n show [a]_m = [b]_m from\n calc [a]_m\n _ = [b + (a - b)]_m := by rw [h2]\n _ = [b]_m + [a - b]_m := by rw [add_class]\n _ = [b]_m + [0]_m := by rw [h1]\n _ = [b + 0]_m := by rw [add_class]\n _ = [b]_m := by rw [h3]\n done\n done\n\nlemma cc_neg_zero_of_cc_zero (m : Nat) (a : Int) :\n [a]_m = [0]_m \u2192 [-a]_m = [0]_m := by\n assume h1 : [a]_m = [0]_m\n have h2 : 0 + (-a) = -a := by ring\n have h3 : a + (-a) = 0 := by ring\n show [-a]_m = [0]_m from\n calc [-a]_m\n _ = [0 + (-a)]_m := by rw [h2]\n _ = [0]_m + [-a]_m := by rw [add_class]\n _ = [a]_m + [-a]_m := by rw [h1]\n _ = [a + (-a)]_m := by rw [add_class]\n _ = [0]_m := by rw [h3]\n done\n\nlemma cc_neg_zero_iff_cc_zero (m : Nat) (a : Int) :\n [-a]_m = [0]_m \u2194 [a]_m = [0]_m := by\n apply Iff.intro _ (cc_neg_zero_of_cc_zero m a)\n assume h1 : [-a]_m = [0]_m\n have h2 : [-(-a)]_m = [0]_m := cc_neg_zero_of_cc_zero m (-a) h1\n have h3 : -(-a) = a := by ring\n rewrite [h3] at h2\n show [a]_m = [0]_m from h2\n done\n\nlemma cc_mod_0 (a : Int) : [a]_0 = a := by rfl\n\nlemma cc_nat_zero_iff_dvd (m k : Nat) : [k]_m = [0]_m \u2194 m \u2223 k :=\n match m with\n | 0 => by\n have h : (0 : Int) = (\u2191(0 : Nat) : Int) := by rfl\n rewrite [cc_mod_0, cc_mod_0, h, Nat.cast_inj]\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : k = 0\n rewrite [h1]\n show 0 \u2223 0 from dvd_self 0\n done\n \u00b7 -- (\u2190)\n assume h1 : 0 \u2223 k\n obtain (c : Nat) (h2 : k = 0 * c) from h1\n rewrite [h2]\n ring\n done\n done\n | n + 1 => by\n rewrite [cc_eq_iff_val_eq, val_nat_eq_mod, val_zero]\n show k % (n + 1) = 0 \u2194 n + 1 \u2223 k from\n (Nat.dvd_iff_mod_eq_zero (n + 1) k).symm\n done\n\nlemma cc_zero_iff_dvd (m : Nat) (a : Int) : [a]_m = [0]_m \u2194 \u2191m \u2223 a := by\n obtain (k : Nat) (h1 : a = \u2191k \u2228 a = -\u2191k) from Int.eq_nat_or_neg a\n by_cases on h1\n \u00b7 -- Case 1. h1: a = \u2191k\n rewrite [h1, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n \u00b7 -- Case 2. h1: a = -\u2191k\n rewrite [h1, cc_neg_zero_iff_cc_zero, Int.dvd_neg, Int.natCast_dvd_natCast]\n show [\u2191k]_m = [0]_m \u2194 m \u2223 k from cc_nat_zero_iff_dvd m k\n done\n done\n\ntheorem cc_eq_iff_congr (m : Nat) (a b : Int) :\n [a]_m = [b]_m \u2194 a \u2261 b (MOD m) :=\n calc [a]_m = [b]_m\n _ \u2194 [a - b]_m = [0]_m := cc_eq_iff_sub_zero m a b\n _ \u2194 \u2191m \u2223 (a - b) := cc_zero_iff_dvd m (a - b)\n _ \u2194 a \u2261 b (MOD m) := by rfl\n/- End of fundamental properties of congruence classes -/\n\nlemma mod_nonneg (m : Nat) [NeZero m] (a : Int) : 0 \u2264 a % m := by\n have h1 : (\u2191m : Int) \u2260 0 := (Nat.cast_ne_zero).rtl (NeZero.ne m)\n show 0 \u2264 a % m from Int.emod_nonneg a h1\n done\n\nlemma mod_lt (m : Nat) [NeZero m] (a : Int) : a % m < m := by\n have h1 : m > 0 := Nat.pos_of_ne_zero (NeZero.ne m)\n have h2 : (\u2191m : Int) > 0 := (Nat.cast_pos).rtl h1\n show a % m < m from Int.emod_lt_of_pos a h2\n done\n\nlemma congr_mod_mod (m : Nat) (a : Int) : a \u2261 a % m (MOD m) := by\n define\n have h1 : m * (a / m) + a % m = a := Int.ediv_add_emod a m\n apply Exists.intro (a / m)\n show a - a % m = m * (a / m) from\n calc a - (a % m)\n _ = m * (a / m) + a % m - a % m := by rw [h1]\n _ = m * (a / m) := by ring\n done\n\nlemma mod_cmpl_res (m : Nat) [NeZero m] (a : Int) :\n 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) :=\n And.intro (mod_nonneg m a) (And.intro (mod_lt m a) (congr_mod_mod m a))\n\ntheorem Theorem_7_3_1 (m : Nat) [NeZero m] (a : Int) :\n \u2203! (r : Int), 0 \u2264 r \u2227 r < m \u2227 a \u2261 r (MOD m) := by\n exists_unique\n \u00b7 -- Existence\n apply Exists.intro (a % m)\n show 0 \u2264 a % m \u2227 a % m < m \u2227 a \u2261 a % m (MOD m) from\n mod_cmpl_res m a\n done\n \u00b7 -- Uniqueness\n fix r1 : Int; fix r2 : Int\n assume h1 : 0 \u2264 r1 \u2227 r1 < m \u2227 a \u2261 r1 (MOD m)\n assume h2 : 0 \u2264 r2 \u2227 r2 < m \u2227 a \u2261 r2 (MOD m)\n have h3 : r1 \u2261 r2 (MOD m) :=\n congr_trans (congr_symm h1.right.right) h2.right.right\n obtain (d : Int) (h4 : r1 - r2 = m * d) from h3\n have h5 : r1 - r2 < m * 1 := by linarith\n have h6 : m * (-1) < r1 - r2 := by linarith\n rewrite [h4] at h5 --h5 : m * d < m * 1\n rewrite [h4] at h6 --h6 : m * -1 < m * d\n have h7 : (\u2191m : Int) \u2265 0 := Nat.cast_nonneg m\n have h8 : d < 1 := lt_of_mul_lt_mul_of_nonneg_left h5 h7\n have h9 : -1 < d := lt_of_mul_lt_mul_of_nonneg_left h6 h7\n have h10 : d = 0 := by linarith\n show r1 = r2 from\n calc r1\n _ = r1 - r2 + r2 := by ring\n _ = m * 0 + r2 := by rw [h4, h10]\n _ = r2 := by ring\n done\n done\n\nlemma cc_eq_mod (m : Nat) (a : Int) : [a]_m = [a % m]_m :=\n (cc_eq_iff_congr m a (a % m)).rtl (congr_mod_mod m a)\n\ntheorem Theorem_7_3_6_1 {m : Nat} (X Y : ZMod m) : X + Y = Y + X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n obtain (b : Int) (h2 : Y = [b]_m) from cc_rep Y\n rewrite [h1, h2]\n have h3 : a + b = b + a := by ring\n show [a]_m + [b]_m = [b]_m + [a]_m from\n calc [a]_m + [b]_m\n _ = [a + b]_m := add_class m a b\n _ = [b + a]_m := by rw [h3]\n _ = [b]_m + [a]_m := (add_class m b a).symm\n done\n\ntheorem Theorem_7_3_6_7 {m : Nat} (X : ZMod m) : X * [1]_m = X := by\n obtain (a : Int) (h1 : X = [a]_m) from cc_rep X\n rewrite [h1]\n have h2 : a * 1 = a := by ring\n show [a]_m * [1]_m = [a]_m from\n calc [a]_m * [1]_m\n _ = [a * 1]_m := mul_class m a 1\n _ = [a]_m := by rw [h2]\n done\n\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\nlemma gcd_c2_inv {m a : Nat} (h1 : rel_prime m a) :\n [a]_m * [gcd_c2 m a]_m = [1]_m := by\n set s : Int := gcd_c1 m a\n have h2 : s * m + (gcd_c2 m a) * a = gcd m a := gcd_lin_comb a m\n define at h1\n rewrite [h1, Nat.cast_one] at h2 --h2 : s * \u2191m + gcd_c2 m a * \u2191a = 1\n rewrite [mul_class, cc_eq_iff_congr]\n define --Goal : \u2203 (c : Int), \u2191a * gcd_c2 m a - 1 = \u2191m * c\n apply Exists.intro (-s)\n show a * (gcd_c2 m a) - 1 = m * (-s) from\n calc a * (gcd_c2 m a) - 1\n _ = s * m + (gcd_c2 m a) * a + m * (-s) - 1 := by ring\n _ = 1 + m * (-s) - 1 := by rw [h2]\n _ = m * (-s) := by ring\n done\n\ntheorem Theorem_7_3_7 (m a : Nat) :\n invertible [a]_m \u2194 rel_prime m a := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h1 : invertible [a]_m\n define at h1\n obtain (Y : ZMod m) (h2 : [a]_m * Y = [1]_m) from h1\n obtain (b : Int) (h3 : Y = [b]_m) from cc_rep Y\n rewrite [h3, mul_class, cc_eq_iff_congr] at h2\n define at h2\n obtain (c : Int) (h4 : a * b - 1 = m * c) from h2\n rewrite [Exercise_7_2_6]\n --Goal : \u2203 (s t : Int), s * \u2191m + t * \u2191a = 1\n apply Exists.intro (-c)\n apply Exists.intro b\n show (-c) * m + b * a = 1 from\n calc (-c) * m + b * a\n _ = (-c) * m + (a * b - 1) + 1 := by ring\n _ = (-c) * m + m * c + 1 := by rw [h4]\n _ = 1 := by ring\n done\n \u00b7 -- (\u2190)\n assume h1 : rel_prime m a\n define\n show \u2203 (Y : ZMod m), [a]_m * Y = [1]_m from\n Exists.intro [gcd_c2 m a]_m (gcd_c2_inv h1)\n done\n done\n\n/- Section 7.4 -/\nsection Euler\nopen Euler\n\nlemma num_rp_below_base {m : Nat} :\n num_rp_below m 0 = 0 := by rfl\n\nlemma num_rp_below_step_rp {m j : Nat} (h : rel_prime m j) :\n num_rp_below m (j + 1) = (num_rp_below m j) + 1 := by\n have h1 : num_rp_below m (j + 1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : gcd m j = 1\n rewrite [if_pos h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j + 1\n show num_rp_below m (j + 1) = num_rp_below m j + 1 from h1\n done\n\nlemma num_rp_below_step_not_rp {m j : Nat} (h : \u00acrel_prime m j) :\n num_rp_below m (j + 1) = num_rp_below m j := by\n have h1 : num_rp_below m (j +1) =\n if gcd m j = 1 then (num_rp_below m j) + 1\n else num_rp_below m j := by rfl\n define at h --h : \u00acgcd m j = 1\n rewrite [if_neg h] at h1\n --h1 : num_rp_below m (j + 1) = num_rp_below m j\n show num_rp_below m (j + 1) = num_rp_below m j from h1\n done\n\nlemma phi_def (m : Nat) : phi m = num_rp_below m m := by rfl\n\n#eval phi 10 --Answer: 4\n\nlemma prod_inv_iff_inv {m : Nat} {X : ZMod m}\n (h1 : invertible X) (Y : ZMod m) :\n invertible (X * Y) \u2194 invertible Y := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : invertible (X * Y)\n obtain (Z : ZMod m) (h3 : X * Y * Z = [1]_m) from h2\n apply Exists.intro (X * Z)\n rewrite [\u2190h3] --Goal : Y * (X * Z) = X * Y * Z\n ring --Note that ring can do algebra in ZMod m\n done\n \u00b7 -- (\u2190)\n assume h2 : invertible Y\n obtain (Xi : ZMod m) (h3 : X * Xi = [1]_m) from h1\n obtain (Yi : ZMod m) (h4 : Y * Yi = [1]_m) from h2\n apply Exists.intro (Xi * Yi)\n show (X * Y) * (Xi * Yi) = [1]_m from\n calc X * Y * (Xi * Yi)\n _ = (X * Xi) * (Y * Yi) := by ring\n _ = [1]_m * [1]_m := by rw [h3, h4]\n _ = [1]_m := Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma F_rp_def {m i : Nat} (h : rel_prime m i) :\n F m i = [i]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h --h : gcd m i = 1\n rewrite [if_pos h] at h1\n show F m i = [i]_m from h1\n done\n\nlemma F_not_rp_def {m i : Nat} (h : \u00acrel_prime m i) :\n F m i = [1]_m := by\n have h1 : F m i = if gcd m i = 1 then [i]_m else [1]_m := by rfl\n define at h\n rewrite [h1, if_neg h]\n rfl\n done\n\nlemma prod_seq_base {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 0 k f = [1]_m := by rfl\n\nlemma prod_seq_step {m : Nat}\n (n k : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) k f = prod_seq n k f * f (k + n) := by rfl\n\nlemma prod_seq_zero_step {m : Nat}\n (n : Nat) (f : Nat \u2192 ZMod m) :\n prod_seq (n + 1) 0 f = prod_seq n 0 f * f n := by\n rewrite [prod_seq_step, zero_add]\n rfl\n done\n\nlemma prod_one {m : Nat}\n (k : Nat) (f : Nat \u2192 ZMod m) : prod_seq 1 k f = f k := by\n rewrite [prod_seq_step, prod_seq_base, add_zero, mul_comm, Theorem_7_3_6_7]\n rfl\n done\n\nlemma G_def (m a i : Nat) : G m a i = (a * i) % m := by rfl\n\nlemma cc_G (m a i : Nat) : [G m a i]_m = [a]_m * [i]_m :=\n calc [G m a i]_m\n _ = [(a * i) % m]_m := by rfl\n _ = [a * i]_m := (cc_eq_mod m (a * i)).symm\n _ = [a]_m * [i]_m := (mul_class m a i).symm\n\nlemma G_rp_iff {m a : Nat} (h1 : rel_prime m a) (i : Nat) :\n rel_prime m (G m a i) \u2194 rel_prime m i := by\n have h2 : invertible [a]_m := (Theorem_7_3_7 m a).rtl h1\n show rel_prime m (G m a i) \u2194 rel_prime m i from\n calc rel_prime m (G m a i)\n _ \u2194 invertible [G m a i]_m := (Theorem_7_3_7 m (G m a i)).symm\n _ \u2194 invertible ([a]_m * [i]_m) := by rw [cc_G]\n _ \u2194 invertible [i]_m := prod_inv_iff_inv h2 ([i]_m)\n _ \u2194 rel_prime m i := Theorem_7_3_7 m i\n done\n\nlemma FG_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : rel_prime m i) :\n F m (G m a i) = [a]_m * F m i := by\n have h3 : rel_prime m (G m a i) := (G_rp_iff h1 i).rtl h2\n show F m (G m a i) = [a]_m * F m i from\n calc F m (G m a i)\n _ = [G m a i]_m := F_rp_def h3\n _ = [a]_m * [i]_m := cc_G m a i\n _ = [a]_m * F m i := by rw [F_rp_def h2]\n done\n\nlemma FG_not_rp {m a i : Nat} (h1 : rel_prime m a) (h2 : \u00acrel_prime m i) :\n F m (G m a i) = [1]_m := by\n rewrite [\u2190G_rp_iff h1 i] at h2\n show F m (G m a i) = [1]_m from F_not_rp_def h2\n done\n\nlemma FG_prod {m a : Nat} (h1 : rel_prime m a) :\n \u2200 (k : Nat), prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) := by\n by_induc\n \u00b7 -- Base Case\n show prod_seq 0 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) from\n calc prod_seq 0 0 ((F m) \u2218 (G m a))\n _ = [1]_m := prod_seq_base _ _\n _ = [a]_m ^ 0 * [1]_m := by ring\n _ = [a]_m ^ (num_rp_below m 0) * prod_seq 0 0 (F m) := by\n rw [num_rp_below_base, prod_seq_base]\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : prod_seq k 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m)\n by_cases h2 : rel_prime m k\n \u00b7 -- Case 1. h2 : rel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([a]_m * F m k) := by rw [FG_rp h1 h2]\n _ = [a]_m ^ ((num_rp_below m k) + 1) *\n ((prod_seq k 0 (F m)) * F m k) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_rp h2, prod_seq_zero_step]\n done\n \u00b7 -- Case 2. h2 : \u00acrel_prime m k\n show prod_seq (k + 1) 0 ((F m) \u2218 (G m a)) =\n [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) from\n calc prod_seq (k + 1) 0 ((F m) \u2218 (G m a))\n _ = prod_seq k 0 ((F m) \u2218 (G m a)) *\n F m (G m a k) := prod_seq_zero_step _ _\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n F m (G m a k) := by rw [ih]\n _ = [a]_m ^ (num_rp_below m k) * prod_seq k 0 (F m) *\n ([1]_m) := by rw [FG_not_rp h1 h2]\n _ = [a]_m ^ (num_rp_below m k) *\n (prod_seq k 0 (F m) * ([1]_m)) := by ring\n _ = [a]_m ^ (num_rp_below m (k + 1)) *\n prod_seq (k + 1) 0 (F m) := by\n rw [num_rp_below_step_not_rp h2, prod_seq_zero_step,\n F_not_rp_def h2]\n done\n done\n done\n\nlemma G_maps_below (m a : Nat) [NeZero m] : maps_below m (G m a) := by\n define --Goal : \u2200 i < m, G m a i < m\n fix i : Nat\n assume h1 : i < m\n rewrite [G_def] --Goal : a * i % m < m\n show a * i % m < m from mod_nonzero_lt (a * i) (NeZero.ne m)\n done\n\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\nlemma right_inv_onto_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g (g' i) = i) (h2 : maps_below n g') :\n onto_below n g := by\n define at h2; define\n fix k : Nat\n assume h3 : k < n\n apply Exists.intro (g' k)\n show g' k < n \u2227 g (g' k) = k from And.intro (h2 k h3) (h1 k h3)\n done\n\nlemma cc_mul_inv_mod_eq_one {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m * [inv_mod m a]_m = [1]_m := by\n have h2 : 0 \u2264 (gcd_c2 m a) % m := mod_nonneg m (gcd_c2 m a)\n show [a]_m * [inv_mod m a]_m = [1]_m from\n calc [a]_m * [inv_mod m a]_m\n _ = [a]_m * [Int.toNat ((gcd_c2 m a) % m)]_m := by rfl\n _ = [a]_m * [(gcd_c2 m a) % m]_m := by rw [Int.toNat_of_nonneg h2]\n _ = [a]_m * [gcd_c2 m a]_m := by rw [\u2190cc_eq_mod]\n _ = [1]_m := gcd_c2_inv h1\n done\n\nlemma mul_mod_mod_eq_mul_mod (m a b : Nat) : (a * (b % m)) % m = (a * b) % m :=\n calc a * (b % m) % m\n = a % m * (b % m % m) % m := Nat.mul_mod _ _ _\n _ = a % m * (b % m) % m := by rw [Nat.mod_mod]\n _ = a * b % m := (Nat.mul_mod _ _ _).symm\n\nlemma mod_mul_mod_eq_mul_mod (m a b : Nat) : (a % m * b) % m = (a * b) % m := by\n rewrite [mul_comm, mul_mod_mod_eq_mul_mod, mul_comm]\n rfl\n done\n\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\nlemma mul_inv_mod_cancel {m a i : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : i < m) : a * (inv_mod m a) * i % m = i := by\n have h3 : [a]_m * [inv_mod m a]_m = [1]_m := cc_mul_inv_mod_eq_one h1\n rewrite [mul_class, cc_eq_iff_congr, \u2190Nat.cast_mul, \u2190Nat.cast_one, congr_iff_mod_eq_Nat] at h3\n show a * inv_mod m a * i % m = i from\n calc a * (inv_mod m a) * i % m\n _ = (a * inv_mod m a) % m * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = 1 % m * i % m := by rw [h3]\n _ = 1 * i % m := by rw [mod_mul_mod_eq_mul_mod]\n _ = i % m := by rw [one_mul]\n _ = i := Nat.mod_eq_of_lt h2\n done\n\nlemma Ginv_def {m a i : Nat} : Ginv m a i = G m (inv_mod m a) i := by rfl\n\nlemma Ginv_right_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, G m a (Ginv m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show G m a (Ginv m a i) = i from\n calc G m a (Ginv m a i)\n _ = a * ((inv_mod m a * i) % m) % m := by rfl\n _ = a * (inv_mod m a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_left_inv {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n \u2200 i < m, Ginv m a (G m a i) = i := by\n fix i : Nat\n assume h2 : i < m\n show Ginv m a (G m a i) = i from\n calc Ginv m a (G m a i)\n _ = inv_mod m a * ((a * i) % m) % m := by rfl\n _ = inv_mod m a * (a * i) % m := by rw [mul_mod_mod_eq_mul_mod]\n _ = a * inv_mod m a * i % m := by rw [\u2190mul_assoc, mul_comm (inv_mod m a)]\n _ = i := mul_inv_mod_cancel h1 h2\n done\n\nlemma Ginv_maps_below (m a : Nat) [NeZero m] :\n maps_below m (Ginv m a) := G_maps_below m (inv_mod m a)\n\nlemma G_one_one_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n one_one_below m (G m a) :=\n left_inv_one_one_below (Ginv_left_inv h1)\n\nlemma G_onto_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n onto_below m (G m a) :=\n right_inv_onto_below (Ginv_right_inv h1) (Ginv_maps_below m a)\n\nlemma G_perm_below {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n perm_below m (G m a) := And.intro (G_maps_below m a)\n (And.intro (G_one_one_below h1) (G_onto_below h1))\n\n--Permuting a product of congruence classes doesn't change product\nlemma swap_fst (u v : Nat) : swap u v u = v := by\n define : swap u v u\n --Goal : (if u = u then v else if u = v then u else u) = v\n have h : u = u := by rfl\n rewrite [if_pos h]\n rfl\n done\n\nlemma swap_snd (u v : Nat) : swap u v v = u := by\n define : swap u v v\n by_cases h1 : v = u\n \u00b7 -- Case 1. h1 : v = u\n rewrite [if_pos h1]\n show v = u from h1\n done\n \u00b7 -- Case 2. h1 : v \u2260 u\n rewrite [if_neg h1]\n have h2 : v = v := by rfl\n rewrite [if_pos h2]\n rfl\n done\n done\n\nlemma swap_other {u v i : Nat} (h1 : i \u2260 u) (h2 : i \u2260 v) : swap u v i = i := by\n define : swap u v i\n rewrite [if_neg h1, if_neg h2]\n rfl\n done\n\nlemma swap_values (u v i : Nat) : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := by\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n apply Or.inl\n rewrite [h1]\n show swap u v u = v from swap_fst u v\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n apply Or.inr\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n apply Or.inl\n rewrite [h2]\n show swap u v v = u from swap_snd u v\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n apply Or.inr\n show swap u v i = i from swap_other h1 h2\n done\n done\n done\n\nlemma swap_maps_below {u v n : Nat} (h1 : u < n) (h2 : v < n) : maps_below n (swap u v) := by\n define\n fix i : Nat\n assume h3 : i < n\n have h4 : swap u v i = v \u2228 swap u v i = u \u2228 swap u v i = i := swap_values u v i\n by_cases on h4\n \u00b7 -- Case 1. h4 : swap u v i = v\n rewrite [h4]\n show v < n from h2\n done\n \u00b7 -- Case 2.\n by_cases on h4\n \u00b7 -- Case 2.1. h4 : swap u v i = u\n rewrite [h4]\n show u < n from h1\n done\n \u00b7 -- Case 2.2. h4 : swap u v i = i\n rewrite [h4]\n show i < n from h3\n done\n done\n done\n\nlemma swap_swap (u v n : Nat) : \u2200 i < n, swap u v (swap u v i) = i := by\n fix i : Nat\n assume h : i < n\n by_cases h1 : i = u\n \u00b7 -- Case 1. h1 : i = u\n rewrite [h1, swap_fst, swap_snd]\n rfl\n done\n \u00b7 -- Case 2. h1 : i \u2260 u\n by_cases h2 : i = v\n \u00b7 -- Case 2.1. h2 : i = v\n rewrite [h2, swap_snd, swap_fst]\n rfl\n done\n \u00b7 -- Case 2.2. h2 : i \u2260 v\n rewrite [swap_other h1 h2, swap_other h1 h2]\n rfl\n done\n done\n done\n\nlemma swap_one_one_below (u v n) : one_one_below n (swap u v) :=\n left_inv_one_one_below (swap_swap u v n)\n\nlemma swap_onto_below {u v n} (h1 : u < n) (h2 : v < n) : onto_below n (swap u v) :=\n right_inv_onto_below (swap_swap u v n) (swap_maps_below h1 h2)\n\nlemma swap_perm_below {u v n} (h1 : u < n) (h2 : v < n) : perm_below n (swap u v) :=\n And.intro (swap_maps_below h1 h2) (And.intro (swap_one_one_below u v n) (swap_onto_below h1 h2))\n\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\nlemma trivial_swap (u : Nat) : swap u u = id := by\n apply funext\n fix x : Nat\n by_cases h1 : x = u\n \u00b7 -- Case 1. h1 : x = u\n rewrite [h1, swap_fst]\n rfl\n done\n \u00b7 -- Case 2. h1 : x \u2260 u\n rewrite [swap_other h1 h1]\n rfl\n done\n done\n\nlemma prod_eq_fun {m : Nat} (f g : Nat \u2192 ZMod m) (k : Nat) :\n \u2200 (n : Nat), (\u2200 i < n, f (k + i) = g (k + i)) \u2192\n prod_seq n k f = prod_seq n k g := by\n by_induc\n \u00b7 -- Base Case\n assume h : (\u2200 i < 0, f (k + i) = g (k + i))\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : (\u2200 i < n, f (k + i) = g (k + i)) \u2192 prod_seq n k f = prod_seq n k g\n assume h1 : \u2200 i < n + 1, f (k + i) = g (k + i)\n have h2 : \u2200 i < n, f (k + i) = g (k + i) := by\n fix i : Nat\n assume h2 : i < n\n have h3 : i < n + 1 := by linarith\n show f (k + i) = g (k + i) from h1 i h3\n done\n have h3 : prod_seq n k f = prod_seq n k g := ih h2\n have h4 : n < n + 1 := Nat.lt_succ_self n\n rewrite [prod_seq_step, prod_seq_step, h3, h1 n h4]\n rfl\n done\n done\n\nlemma swap_prod_eq_prod_below {m u n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : u \u2264 n) : prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f := by\n have h2 : \u2200 (i : Nat), i < u \u2192 (f \u2218 swap u n) (0 + i) = f (0 + i) := by\n fix i : Nat\n assume h2 : i < u\n have h3 : 0 + i \u2260 u := by linarith\n have h4 : 0 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n done\n show prod_seq u 0 (f \u2218 swap u n) = prod_seq u 0 f from\n prod_eq_fun (f \u2218 swap u n) f 0 u h2\n done\n\nlemma swap_prod_eq_prod_between {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := by\n have h2 : \u2200 i < j, (f \u2218 swap u n) (u + 1 + i) = f (u + 1 + i) := by\n fix i : Nat\n assume h2 : i < j\n have h3 : u + 1 + i \u2260 u := by linarith\n have h4 : u + 1 + i \u2260 n := by linarith\n rewrite [comp_def, swap_other h3 h4]\n rfl\n show prod_seq j (u + 1) (f \u2218 swap u n) = prod_seq j (u + 1) f from\n prod_eq_fun (f \u2218 swap u n) f (u + 1) j h2\n done\n\nlemma break_prod {m : Nat} (n : Nat) (f : Nat \u2192 ZMod m) :\n \u2200 (j : Nat), prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f := by\n by_induc\n \u00b7 -- Base Case\n have h : n + 0 = n := by rfl\n rewrite [prod_seq_base, h, Theorem_7_3_6_7]\n rfl\n done\n \u00b7 -- Induction Step\n fix j : Nat\n assume ih : prod_seq (n + j) 0 f = prod_seq n 0 f * prod_seq j n f\n rewrite [\u2190add_assoc, prod_seq_zero_step, prod_seq_step, ih, mul_assoc]\n rfl\n done\n done\n\nlemma break_prod_twice {m u j n : Nat} (f : Nat \u2192 ZMod m)\n (h1 : n = u + 1 + j) : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by\n have h2 : prod_seq (n + 1) 0 f = prod_seq n 0 f * prod_seq 1 n f :=\n break_prod n f 1\n rewrite [prod_one] at h2\n have h3 : prod_seq (u + 1 + j) 0 f = prod_seq (u + 1) 0 f * prod_seq j (u + 1) f :=\n break_prod (u + 1) f j\n rewrite [\u2190h1] at h3\n have h4 : prod_seq (u + 1) 0 f = prod_seq u 0 f * prod_seq 1 u f :=\n break_prod u f 1\n rewrite [prod_one] at h4\n rewrite [h3, h4] at h2\n show prod_seq (n + 1) 0 f = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n from h2\n done\n\nlemma swap_prod_eq_prod {m u n : Nat} (f : Nat \u2192 ZMod m) (h1 : u \u2264 n) :\n prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f := by\n by_cases h2 : u = n\n \u00b7 -- Case 1. h2 : u = n\n rewrite [h2, trivial_swap n]\n --Goal : prod_seq (n + 1) 0 (f \u2218 id) = prod_seq (n + 1) 0 f\n rfl\n done\n \u00b7 -- Case 2. h2 : \u00acu = n\n have h3 : u + 1 \u2264 n := Nat.lt_of_le_of_ne h1 h2\n obtain (j : Nat) (h4 : n = u + 1 + j) from Nat.exists_eq_add_of_le h3\n have break_f : prod_seq (n + 1) 0 f =\n prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n :=\n break_prod_twice f h4\n have break_fs : prod_seq (n + 1) 0 (f \u2218 swap u n) =\n prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_prod_twice (f \u2218 swap u n) h4\n have f_eq_fs_below : prod_seq u 0 (f \u2218 swap u n) =\n prod_seq u 0 f := swap_prod_eq_prod_below f h1\n have f_eq_fs_btwn : prod_seq j (u + 1) (f \u2218 swap u n) =\n prod_seq j (u + 1) f := swap_prod_eq_prod_between f h4\n show prod_seq (n + 1) 0 (f \u2218 swap u n) = prod_seq (n + 1) 0 f from\n calc prod_seq (n + 1) 0 (f \u2218 swap u n)\n _ = prod_seq u 0 (f \u2218 swap u n) * (f \u2218 swap u n) u *\n prod_seq j (u + 1) (f \u2218 swap u n) * (f \u2218 swap u n) n :=\n break_fs\n _ = prod_seq u 0 f * (f \u2218 swap u n) u *\n prod_seq j (u + 1) f * (f \u2218 swap u n) n := by\n rw [f_eq_fs_below, f_eq_fs_btwn]\n _ = prod_seq u 0 f * f (swap u n u) *\n prod_seq j (u + 1) f * f (swap u n n) := by rfl\n _ = prod_seq u 0 f * f n * prod_seq j (u + 1) f * f u := by\n rw [swap_fst, swap_snd]\n _ = prod_seq u 0 f * f u * prod_seq j (u + 1) f * f n := by ring\n _ = prod_seq (n + 1) 0 f := break_f.symm\n done\n done\n\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\nlemma perm_prod {m : Nat} (f : Nat \u2192 ZMod m) :\n \u2200 (n : Nat), \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g) := by\n by_induc\n \u00b7 -- Base Case\n fix g : Nat \u2192 Nat\n assume h1 : perm_below 0 g\n rewrite [prod_seq_base, prod_seq_base]\n rfl\n done\n \u00b7 -- Induction Step\n fix n : Nat\n assume ih : \u2200 (g : Nat \u2192 Nat), perm_below n g \u2192\n prod_seq n 0 f = prod_seq n 0 (f \u2218 g)\n fix g : Nat \u2192 Nat\n assume g_pb : perm_below (n + 1) g\n define at g_pb\n have g_ob : onto_below (n + 1) g := g_pb.right.right\n define at g_ob\n have h1 : n < n + 1 := by linarith\n obtain (u : Nat) (h2 : u < n + 1 \u2227 g u = n) from g_ob n h1\n have s_pb : perm_below (n + 1) (swap u n) :=\n swap_perm_below h2.left h1\n have gs_pb_n1 : perm_below (n + 1) (g \u2218 swap u n) :=\n comp_perm_below g_pb s_pb\n have gs_fix_n : (g \u2218 swap u n) n = n :=\n calc (g \u2218 swap u n) n\n _ = g (swap u n n) := by rfl\n _ = g u := by rw [swap_snd]\n _ = n := h2.right\n have gs_pb_n : perm_below n (g \u2218 swap u n) :=\n perm_below_fixed gs_pb_n1 gs_fix_n\n have gs_prod : prod_seq n 0 f = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) :=\n ih (g \u2218 swap u n) gs_pb_n\n have h3 : u \u2264 n := by linarith\n show prod_seq (n + 1) 0 f = prod_seq (n + 1) 0 (f \u2218 g) from\n calc prod_seq (n + 1) 0 f\n _ = prod_seq n 0 f * f n := prod_seq_zero_step n f\n _ = prod_seq n 0 (f \u2218 (g \u2218 swap u n)) *\n f ((g \u2218 swap u n) n) := by rw [gs_prod, gs_fix_n]\n _ = prod_seq n 0 (f \u2218 g \u2218 swap u n) *\n (f \u2218 g \u2218 swap u n) n := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g \u2218 swap u n) :=\n (prod_seq_zero_step n (f \u2218 g \u2218 swap u n)).symm\n _ = prod_seq (n + 1) 0 ((f \u2218 g) \u2218 swap u n) := by rfl\n _ = prod_seq (n + 1) 0 (f \u2218 g) := swap_prod_eq_prod (f \u2218 g) h3\n done\n done\n\nlemma F_invertible (m i : Nat) : invertible (F m i) := by\n by_cases h : rel_prime m i\n \u00b7 -- Case 1. h : rel_prime m i\n rewrite [F_rp_def h]\n show invertible [i]_m from (Theorem_7_3_7 m i).rtl h\n done\n \u00b7 -- Case 2. h : \u00acrel_prime m i\n rewrite [F_not_rp_def h]\n apply Exists.intro [1]_m\n show [1]_m * [1]_m = [1]_m from Theorem_7_3_6_7 [1]_m\n done\n done\n\nlemma Fprod_invertible (m : Nat) :\n \u2200 (k : Nat), invertible (prod_seq k 0 (F m)) := by\n by_induc\n \u00b7 -- Base Case\n apply Exists.intro [1]_m\n show prod_seq 0 0 (F m) * [1]_m = [1]_m from\n calc prod_seq 0 0 (F m) * [1]_m\n _ = [1]_m * [1]_m := by rw [prod_seq_base]\n _ = [1]_m := Theorem_7_3_6_7 ([1]_m)\n done\n \u00b7 -- Induction Step\n fix k : Nat\n assume ih : invertible (prod_seq k 0 (F m))\n rewrite [prod_seq_zero_step]\n show invertible (prod_seq k 0 (F m) * (F m k)) from\n (prod_inv_iff_inv ih (F m k)).rtl (F_invertible m k)\n done\n done\n\ntheorem Theorem_7_4_2 {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n [a]_m ^ (phi m) = [1]_m := by\n have h2 : invertible (prod_seq m 0 (F m)) := Fprod_invertible m m\n obtain (Y : ZMod m) (h3 : prod_seq m 0 (F m) * Y = [1]_m) from h2\n show [a]_m ^ (phi m) = [1]_m from\n calc [a]_m ^ (phi m)\n _ = [a]_m ^ (phi m) * [1]_m := (Theorem_7_3_6_7 _).symm\n _ = [a]_m ^ (phi m) * (prod_seq m 0 (F m) * Y) := by rw [h3]\n _ = ([a]_m ^ (phi m) * prod_seq m 0 (F m)) * Y := by ring\n _ = prod_seq m 0 (F m \u2218 G m a) * Y := by rw [FG_prod h1 m, phi_def]\n _ = prod_seq m 0 (F m) * Y := by\n rw [perm_prod (F m) m (G m a) (G_perm_below h1)]\n _ = [1]_m := by rw [h3]\n done\n\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\nlemma Exercise_7_4_5_Nat (m a n : Nat) :\n [a]_m ^ n = [a ^ n]_m := by\n rewrite [Exercise_7_4_5_Int]\n rfl\n done\n\ntheorem Euler's_theorem {m a : Nat} [NeZero m]\n (h1 : rel_prime m a) : a ^ (phi m) \u2261 1 (MOD m) := by\n have h2 : [a]_m ^ (phi m) = [1]_m := Theorem_7_4_2 h1\n rewrite [Exercise_7_4_5_Nat m a (phi m)] at h2\n --h2 : [a ^ phi m]_m = [1]_m\n show a ^ (phi m) \u2261 1 (MOD m) from (cc_eq_iff_congr _ _ _).ltr h2\n done\n\n#eval gcd 10 7 --Answer: 1. So 10 and 7 are relatively prime\n\n#eval 7 ^ phi 10 --Answer: 2401, which is congruent to 1 mod 10.\n\nend Euler\n\n/- Section 7.5 -/\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\nlemma phi_prime {p : Nat} (h1 : prime p) : phi p = p - 1 := by\n have h2 : 1 \u2264 p := prime_pos h1\n have h3 : p - 1 + 1 = p := Nat.sub_add_cancel h2\n have h4 : p - 1 < p := by linarith\n have h5 : num_rp_below p (p - 1 + 1) = p - 1 :=\n num_rp_prime h1 (p - 1) h4\n rewrite [h3] at h5\n show phi p = p - 1 from h5\n done\n\ntheorem Theorem_7_2_2_Int {a c : Nat} {b : Int}\n (h1 : \u2191c \u2223 \u2191a * b) (h2 : rel_prime a c) : \u2191c \u2223 b := by\n rewrite [Int.natCast_dvd, Int.natAbs_mul,\n Int.natAbs_ofNat] at h1 --h1 : c \u2223 a * Int.natAbs b\n rewrite [Int.natCast_dvd] --Goal : c \u2223 Int.natAbs b\n show c \u2223 Int.natAbs b from Theorem_7_2_2 h1 h2\n done\n\nlemma Lemma_7_4_5 {m n : Nat} (a b : Int) (h1 : rel_prime m n) :\n a \u2261 b (MOD m * n) \u2194 a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n) := by\n apply Iff.intro\n \u00b7 -- (\u2192)\n assume h2 : a \u2261 b (MOD m * n)\n obtain (j : Int) (h3 : a - b = (m * n) * j) from h2\n apply And.intro\n \u00b7 -- Proof of a \u2261 b (MOD m)\n apply Exists.intro (n * j)\n show a - b = m * (n * j) from\n calc a - b\n _ = m * n * j := h3\n _ = m * (n * j) := by ring\n done\n \u00b7 -- Proof of a \u2261 b (MOD n)\n apply Exists.intro (m * j)\n show a - b = n * (m * j) from\n calc a - b\n _ = m * n * j := h3\n _ = n * (m * j) := by ring\n done\n done\n \u00b7 -- (\u2190)\n assume h2 : a \u2261 b (MOD m) \u2227 a \u2261 b (MOD n)\n obtain (j : Int) (h3 : a - b = m * j) from h2.left\n have h4 : (\u2191n : Int) \u2223 a - b := h2.right\n rewrite [h3] at h4 --h4 : \u2191n \u2223 \u2191m * j\n have h5 : \u2191n \u2223 j := Theorem_7_2_2_Int h4 h1\n obtain (k : Int) (h6 : j = n * k) from h5\n apply Exists.intro k --Goal : a - b = \u2191(m * n) * k\n rewrite [Nat.cast_mul] --Goal : a - b = \u2191m * \u2191n * k\n show a - b = (m * n) * k from\n calc a - b\n _ = m * j := h3\n _ = m * (n * k) := by rw [h6]\n _ = (m * n) * k := by ring\n done\n done\n\n--From exercises of Section 7.2\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\nlemma prime_NeZero {p : Nat} (h : prime p) : NeZero p := by\n rewrite [neZero_iff] --Goal : p \u2260 0\n define at h\n linarith\n done\n\nlemma Lemma_7_5_1 {p e d m c s : Nat} {t : Int}\n (h1 : prime p) (h2 : e * d = (p - 1) * s + 1)\n (h3 : m ^ e - c = p * t) :\n c ^ d \u2261 m (MOD p) := by\n have h4 : m ^ e \u2261 c (MOD p) := Exists.intro t h3\n have h5 : [m ^ e]_p = [c]_p := (cc_eq_iff_congr _ _ _).rtl h4\n rewrite [\u2190Exercise_7_4_5_Nat] at h5 --h5 : [m]_p ^ e = [c]_p\n by_cases h6 : p \u2223 m\n \u00b7 -- Case 1. h6 : p \u2223 m\n have h7 : m \u2261 0 (MOD p) := by\n obtain (j : Nat) (h8 : m = p * j) from h6\n apply Exists.intro (\u2191j : Int) --Goal : \u2191m - 0 = \u2191p * \u2191j\n rewrite [h8, Nat.cast_mul]\n ring\n done\n have h8 : [m]_p = [0]_p := (cc_eq_iff_congr _ _ _).rtl h7\n have h9 : e * d \u2260 0 := by\n rewrite [h2]\n show (p - 1) * s + 1 \u2260 0 from Nat.add_one_ne_zero _\n done\n have h10 : (0 : Int) ^ (e * d) = 0 := zero_pow h9\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [0]_p ^ (e * d) := by rw [h8]\n _ = [0 ^ (e * d)]_p := Exercise_7_4_5_Int _ _ _\n _ = [0]_p := by rw [h10]\n _ = [m]_p := by rw [h8]\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n \u00b7 -- Case 2. h6 : \u00acp \u2223 m\n have h7 : rel_prime m p := rel_prime_of_prime_not_dvd h1 h6\n have h8 : rel_prime p m := rel_prime_symm h7\n have h9 : NeZero p := prime_NeZero h1\n have h10 : (1 : Int) ^ s = 1 := by ring\n have h11 : [c ^ d]_p = [m]_p :=\n calc [c ^ d]_p\n _ = [c]_p ^ d := by rw [Exercise_7_4_5_Nat]\n _ = ([m]_p ^ e) ^ d := by rw [h5]\n _ = [m]_p ^ (e * d) := by ring\n _ = [m]_p ^ ((p - 1) * s + 1) := by rw [h2]\n _ = ([m]_p ^ (p - 1)) ^ s * [m]_p := by ring\n _ = ([m]_p ^ (phi p)) ^ s * [m]_p := by rw [phi_prime h1]\n _ = [1]_p ^ s * [m]_p := by rw [Theorem_7_4_2 h8]\n _ = [1 ^ s]_p * [m]_p := by rw [Exercise_7_4_5_Int]\n _ = [1]_p * [m]_p := by rw [h10]\n _ = [m]_p * [1]_p := by ring\n _ = [m]_p := Theorem_7_3_6_7 _\n show c ^ d \u2261 m (MOD p) from (cc_eq_iff_congr _ _ _).ltr h11\n done\n done\n\ntheorem Theorem_7_5_1 (p q n e d k m c : Nat)\n (p_prime : prime p) (q_prime : prime q) (p_ne_q : p \u2260 q)\n (n_pq : n = p * q) (ed_congr_1 : e * d = k * (p - 1) * (q - 1) + 1)\n (h1 : [m]_n ^ e = [c]_n) : [c]_n ^ d = [m]_n := by\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr] at h1\n --h1 : m ^ e \u2261 c (MOD n)\n rewrite [Exercise_7_4_5_Nat, cc_eq_iff_congr]\n --Goal : c ^ d \u2261 m (MOD n)\n obtain (j : Int) (h2 : m ^ e - c = n * j) from h1\n rewrite [n_pq, Nat.cast_mul] at h2\n --h2 : m ^ e - c = p * q * j\n have h3 : e * d = (p - 1) * (k * (q - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h4 : m ^ e - c = p * (q * j) := by\n rewrite [h2]\n ring\n done\n have congr_p : c ^ d \u2261 m (MOD p) := Lemma_7_5_1 p_prime h3 h4\n have h5 : e * d = (q - 1) * (k * (p - 1)) + 1 := by\n rewrite [ed_congr_1]\n ring\n done\n have h6 : m ^ e - c = q * (p * j) := by\n rewrite [h2]\n ring\n done\n have congr_q : c ^ d \u2261 m (MOD q) := Lemma_7_5_1 q_prime h5 h6\n have h7 : \u00acq \u2223 p := by\n by_contra h8\n have h9 : q = 1 \u2228 q = p := dvd_prime p_prime h8\n disj_syll h9 (prime_not_one q_prime)\n show False from p_ne_q h9.symm\n done\n have h8 : rel_prime p q := rel_prime_of_prime_not_dvd q_prime h7\n rewrite [n_pq, Lemma_7_4_5 _ _ h8]\n show c ^ d \u2261 m (MOD p) \u2227 c ^ d \u2261 m (MOD q) from\n And.intro congr_p congr_q\n done\n\n/- BEGIN EXERCISES -/\n\nnamespace Exercises\n\n/- Section 7.1 -/\n-- 1.\ntheorem dvd_a_of_dvd_b_mod {a b d : Nat}\n (h1 : d \u2223 b) (h2 : d \u2223 (a % b)) : d \u2223 a := sorry\n\n-- 2.\nlemma gcd_comm_lt {a b : Nat} (h : a < b) : gcd a b = gcd b a := sorry\n\ntheorem gcd_comm (a b : Nat) : gcd a b = gcd b a := sorry\n\n-- 3.\ntheorem Exercise_7_1_5 (a b : Nat) (n : Int) :\n (\u2203 (s t : Int), s * a + t * b = n) \u2194 (\u2191(gcd a b) : Int) \u2223 n := sorry\n\n-- 4.\ntheorem Exercise_7_1_6 (a b c : Nat) :\n gcd a b = gcd (a + b * c) b := sorry\n\n-- 5.\ntheorem gcd_is_nonzero {a b : Nat} (h : a \u2260 0 \u2228 b \u2260 0) :\n gcd a b \u2260 0 := sorry\n\n-- 6.\ntheorem gcd_greatest {a b d : Nat} (h1 : gcd a b \u2260 0)\n (h2 : d \u2223 a) (h3 : d \u2223 b) : d \u2264 gcd a b := sorry\n\n-- 7.\nlemma Lemma_7_1_10a {a b : Nat}\n (n : Nat) (h : a \u2223 b) : (n * a) \u2223 (n * b) := sorry\n\nlemma Lemma_7_1_10b {a b n : Nat}\n (h1 : n \u2260 0) (h2 : (n * a) \u2223 (n * b)) : a \u2223 b := sorry\n\nlemma Lemma_7_1_10c {a b : Nat}\n (h1 : a \u2223 b) (h2 : b \u2223 a) : a = b := sorry\n\ntheorem Exercise_7_1_10 (a b n : Nat) :\n gcd (n * a) (n * b) = n * gcd a b := sorry\n\n/- Section 7.2 -/\n-- 1.\nlemma dvd_prime {a p : Nat}\n (h1 : prime p) (h2 : a \u2223 p) : a = 1 \u2228 a = p := sorry\n\n-- 2.\n-- Hints: Start with apply List.rec. You may find mul_ne_zero useful\ntheorem prod_nonzero_nonzero : \u2200 (l : List Nat),\n (\u2200 a \u2208 l, a \u2260 0) \u2192 prod l \u2260 0 := sorry\n\n-- 3.\ntheorem rel_prime_iff_no_common_factor (a b : Nat) :\n rel_prime a b \u2194 \u00ac\u2203 (p : Nat), prime p \u2227 p \u2223 a \u2227 p \u2223 b := sorry\n\n-- 4.\ntheorem rel_prime_symm {a b : Nat} (h : rel_prime a b) :\n rel_prime b a := sorry\n\n-- 5.\nlemma in_prime_factorization_iff_prime_factor {a : Nat} {l : List Nat}\n (h1 : prime_factorization a l) (p : Nat) :\n p \u2208 l \u2194 prime_factor p a := sorry\n\n-- 6.\ntheorem Exercise_7_2_5 {a b : Nat} {l m : List Nat}\n (h1 : prime_factorization a l) (h2 : prime_factorization b m) :\n rel_prime a b \u2194 (\u00ac\u2203 (p : Nat), p \u2208 l \u2227 p \u2208 m) := sorry\n\n-- 7.\ntheorem Exercise_7_2_6 (a b : Nat) :\n rel_prime a b \u2194 \u2203 (s t : Int), s * a + t * b = 1 := sorry\n\n-- 8.\ntheorem Exercise_7_2_7 {a b a' b' : Nat}\n (h1 : rel_prime a b) (h2 : a' \u2223 a) (h3 : b' \u2223 b) :\n rel_prime a' b' := sorry\n\n-- 9.\ntheorem Exercise_7_2_9 {a b j k : Nat}\n (h1 : gcd a b \u2260 0) (h2 : a = j * gcd a b) (h3 : b = k * gcd a b) :\n rel_prime j k := sorry\n\n-- 10.\ntheorem Exercise_7_2_17a (a b c : Nat) :\n gcd a (b * c) \u2223 gcd a b * gcd a c := sorry\n\n/- Section 7.3 -/\n-- 1.\ntheorem congr_trans {m : Nat} : \u2200 {a b c : Int},\n a \u2261 b (MOD m) \u2192 b \u2261 c (MOD m) \u2192 a \u2261 c (MOD m) := sorry\n\n-- 2.\ntheorem Theorem_7_3_6_3 {m : Nat} (X : ZMod m) : X + [0]_m = X := sorry\n\n-- 3.\ntheorem Theorem_7_3_6_4 {m : Nat} (X : ZMod m) :\n \u2203 (Y : ZMod m), X + Y = [0]_m := sorry\n\n-- 4.\ntheorem Exercise_7_3_4a {m : Nat} (Z1 Z2 : ZMod m)\n (h1 : \u2200 (X : ZMod m), X + Z1 = X)\n (h2 : \u2200 (X : ZMod m), X + Z2 = X) : Z1 = Z2 := sorry\n\n-- 5.\ntheorem Exercise_7_3_4b {m : Nat} (X Y1 Y2 : ZMod m)\n (h1 : X + Y1 = [0]_m) (h2 : X + Y2 = [0]_m) : Y1 = Y2 := sorry\n\n-- 6.\ntheorem Theorem_7_3_10 (m a : Nat) (b : Int) :\n \u00ac(\u2191(gcd m a) : Int) \u2223 b \u2192 \u00ac\u2203 (x : Int), a * x \u2261 b (MOD m) := sorry\n\n-- 7.\ntheorem Theorem_7_3_11 (m n : Nat) (a b : Int) (h1 : n \u2260 0) :\n n * a \u2261 n * b (MOD n * m) \u2194 a \u2261 b (MOD m) := sorry\n\n-- 8.\ntheorem Exercise_7_3_16 {m : Nat} {a b : Int} (h : a \u2261 b (MOD m)) :\n \u2200 (n : Nat), a ^ n \u2261 b ^ n (MOD m) := sorry\n\n-- 9.\nexample {m : Nat} [NeZero m] (X : ZMod m) :\n \u2203! (a : Int), 0 \u2264 a \u2227 a < m \u2227 X = [a]_m := sorry\n\n-- 10.\ntheorem congr_rel_prime {m a b : Nat} (h1 : a \u2261 b (MOD m)) :\n rel_prime m a \u2194 rel_prime m b := sorry\n\n-- 11.\n--Hint: You may find the theorem Int.ofNat_mod_ofNat useful.\ntheorem rel_prime_mod (m a : Nat) :\n rel_prime m (a % m) \u2194 rel_prime m a := sorry\n\n-- 12.\nlemma congr_iff_mod_eq_Int (m : Nat) (a b : Int) [NeZero m] :\n a \u2261 b (MOD m) \u2194 a % \u2191m = b % \u2191m := sorry\n\n--Hint for next theorem: Use the lemma above,\n--together with the theorems Int.ofNat_mod_ofNat and Nat.cast_inj.\ntheorem congr_iff_mod_eq_Nat (m a b : Nat) [NeZero m] :\n \u2191a \u2261 \u2191b (MOD m) \u2194 a % m = b % m := sorry\n\n/- Section 7.4 -/\n-- 1.\n--Hint: Use induction.\n--For the base case, compute [a]_m ^ 0 * [1]_m in two ways:\n--by Theorem_7_3_6_7, [a] ^ 0 * [1]_m = [a]_m ^ 0\n--by ring, [a]_m ^ 0 * [1]_m = [1]_m.\nlemma Exercise_7_4_5_Int (m : Nat) (a : Int) :\n \u2200 (n : Nat), [a]_m ^ n = [a ^ n]_m := sorry\n\n-- 2.\nlemma left_inv_one_one_below {n : Nat} {g g' : Nat \u2192 Nat}\n (h1 : \u2200 i < n, g' (g i) = i) : one_one_below n g := sorry\n\n-- 3.\nlemma comp_perm_below {n : Nat} {f g : Nat \u2192 Nat}\n (h1 : perm_below n f) (h2 : perm_below n g) :\n perm_below n (f \u2218 g) := sorry\n\n-- 4.\nlemma perm_below_fixed {n : Nat} {g : Nat \u2192 Nat}\n (h1 : perm_below (n + 1) g) (h2 : g n = n) : perm_below n g := sorry\n\n-- 5.\nlemma Lemma_7_4_6 {a b c : Nat} :\n rel_prime (a * b) c \u2194 rel_prime a c \u2227 rel_prime b c := sorry\n\n-- 6.\nexample {m a : Nat} [NeZero m] (h1 : rel_prime m a) :\n a ^ (phi m + 1) \u2261 a (MOD m) := sorry\n\n-- 7.\ntheorem Like_Exercise_7_4_11 {m a p : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p + 1 = phi m) :\n [a]_m * [a ^ p]_m = [1]_m := sorry\n\n-- 8.\ntheorem Like_Exercise_7_4_12 {m a p q k : Nat} [NeZero m]\n (h1 : rel_prime m a) (h2 : p = q + (phi m) * k) :\n a ^ p \u2261 a ^ q (MOD m) := sorry\n\n/- Section 7.5 -/\n-- 1.\n--Hint: Use induction.\nlemma num_rp_prime {p : Nat} (h1 : prime p) :\n \u2200 k < p, num_rp_below p (k + 1) = k := sorry\n\n-- 2.\nlemma three_prime : prime 3 := sorry\n\n-- 3.\n--Hint: Use the previous exercise, Exercise_7_2_7, and Theorem_7_4_2.\ntheorem Exercise_7_5_13a (a : Nat) (h1 : rel_prime 561 a) :\n a ^ 560 \u2261 1 (MOD 3) := sorry\n\n-- 4.\n--Hint: Imitate the way Theorem_7_2_2_Int was proven from Theorem_7_2_2.\nlemma Theorem_7_2_3_Int {p : Nat} {a b : Int}\n (h1 : prime p) (h2 : \u2191p \u2223 a * b) : \u2191p \u2223 a \u2228 \u2191p \u2223 b := sorry\n\n-- 5.\n--Hint: Use the previous exercise.\n", "theoremStatement": "theorem Exercise_7_5_14b (n : Nat) (b : Int)\n (h1 : prime n) (h2 : b ^ 2 \u2261 1 (MOD n)) :\n b \u2261 1 (MOD n) \u2228 b \u2261 -1 (MOD n) ", "theoremName": "HTPI.Exercises.Exercise_7_5_14b", "fileCreated": {"commit": "c83e1d1", "date": "2023-04-04"}, "theoremCreated": {"commit": "3199c75", "date": "2023-05-17"}, "file": "htpi/HTPILib/Chap7.lean", "module": "HTPILib.Chap7", "jsonFile": "HTPILib.Chap7.jsonl", "positionMetadata": {"lineInFile": 2104, "tokenPositionInFile": 68258, "theoremPositionInFile": 210}, "dependencyMetadata": {"inFilePremises": true, "numInFilePremises": 2, "repositoryPremises": true, "numRepositoryPremises": 2, "numPremises": 16, "importedModules": ["Init.Prelude", "Init.Coe", "Init.Notation", "Init.Tactics", "Init.SizeOf", "Init.Core", "Init.MetaTypes", "Init.SimpLemmas", "Init.Data.Nat.Basic", "Init.WF", "Init.WFTactics", "Init.Data.Nat.Div", "Init.Data.Nat.Bitwise.Basic", "Init.Data.Fin.Basic", "Init.Data.UInt.Basic", "Init.Control.Basic", "Init.Control.Id", "Init.Control.Except", "Init.Control.State", "Init.Data.Cast", "Init.Data.List.Basic", "Init.Data.Int.Basic", "Init.Data.Char.Basic", "Init.Data.Option.Basic", "Init.Data.String.Basic", "Init.Data.Format.Basic", "Init.Data.Repr", "Init.Control.Option", "Init.Data.ToString.Basic", "Init.Util", "Init.Data.Array.Basic", "Init.Data.Option.BasicAux", "Init.Data.Array.Subarray", "Init.Data.ByteArray.Basic", "Init.Data.ByteArray", "Init.Data.String.Extra", "Init.Meta", "Init.Data.ToString.Macro", "Init.Data.ToString", "Init.NotationExtra", "Init.TacticsExtra", "Init.PropLemmas", "Init.Classical", "Init.ByCases", "Init.RCases", "Init.Control.EState", "Init.Control.Reader", "Init.Data.String", "Init.System.IOError", "Init.System.Platform", "Init.System.FilePath", "Init.System.ST", "Init.Data.Int.Bitwise", "Init.Data.Int.DivMod", "Init.Conv", "Init.Data.Int.Lemmas", "Init.Data.Int.Order", "Init.Data.Nat.Dvd", "Init.Data.Int.DivModLemmas", "Init.Data.Nat.Gcd", "Init.Data.Int.Gcd", "Init.Data.Int", "Init.Data.Ord", "Init.System.IO", "Init.Control.StateRef", "Init.Control.Lawful", "Init.Control.StateCps", "Init.Control.ExceptCps", "Init.Control", "Init.Data.Prod", "Init.Data.Nat.Linear", "Init.Data.Nat.Log2", "Init.Data.Fin.Log2", "Init.Data.UInt.Log2", "Init.Data.UInt", "Init.Data.Basic", "Init.Data.Nat.MinMax", "Init.BinderPredicates", "Init.Data.Bool", "Init.Data.Nat.Power2", "Init.Data.Nat.Lemmas", "Init.Omega.Int", "Init.Data.List.BasicAux", "Init.Data.List.Control", "Init.Hints", "Init.Data.List.Lemmas", "Init.Omega.IntList", "Init.Omega.Coeffs", "Init.Omega.LinearCombo", "Init.Omega.Constraint", "Init.Omega.Logic", "Init.Omega", "Init.Data.Nat.Bitwise.Lemmas", "Init.Data.Nat.Bitwise", "Init.Data.Nat.Control", "Init.Data.Nat.SOM", "Init.Data.Nat.Mod", "Init.Data.Nat", "Init.Data.BitVec.Basic", "Init.Ext", "Init.Data.Fin.Lemmas", "Init.Data.BitVec.Lemmas", "Init.Data.Fin.Iterate", "Init.Data.BitVec.Folds", "Init.Data.BitVec.Bitblast", "Init.Data.BitVec", "Init.Data.Char", "Init.Data.List", "Init.Data.Array.QSort", "Init.Data.Array.BinSearch", "Init.Data.Array.InsertionSort", "Init.Data.Array.DecidableEq", "Init.Data.Array.Mem", "Init.Data.Array.BasicAux", "Init.Data.Array.Lemmas", "Init.Data.Array", "Init.Data.Float", "Init.Data.FloatArray.Basic", "Init.Data.FloatArray", "Init.Data.Fin.Fold", "Init.Data.Fin", "Init.Data.Option.Instances", "Init.Data.Option.Lemmas", "Init.Data.Option", "Init.Data.Random", "Init.Data.Range", "Init.Data.Hashable", "Init.Data.OfScientific", "Init.Data.Format.Macro", "Init.Data.Format.Instances", "Init.Data.Format.Syntax", "Init.Data.Format", "Init.Data.Stream", "Init.Data.AC", "Init.Data.Queue", "Init.System.Promise", "Init.System.Mutex", "Init.Data.Channel", "Init.Data.Sum", "Init.Data", "Init.System.Uri", "Init.System", "Init.Dynamic", "Init.ShareCommon", "Init.Guard", "Init.Simproc", "Init.SizeOfLemmas", "Init", "Lean.Data.AssocList", "Lean.Data.HashMap", "Lean.ImportingFlag", "Lean.Data.PersistentHashMap", "Lean.Data.SMap", "Lean.Data.KVMap", "Lean.Data.HashSet", "Lean.Data.PersistentHashSet", "Lean.Data.Name", "Lean.Data.RBMap", "Lean.Data.RBTree", "Lean.Data.SSet", "Lean.Data.NameMap", "Lean.Data.Options", "Lean.Data.Format", "Lean.Hygiene", "Lean.Level", "Lean.Expr", "Lean.Declaration", "Lean.Data.PersistentArray", "Lean.LocalContext", "Lean.Util.Path", "Lean.Util.PtrSet", "Lean.Util.FindExpr", "Lean.Util.Profile", "Lean.Util.ReplaceExpr", "Lean.Util.InstantiateLevelParams", "Lean.Environment", "Lean.ProjFns", "Lean.Structure", "Lean.Util.Recognizers", "Lean.Data.LOption", "Lean.Util.RecDepth", "Lean.ToExpr", "Lean.Data.Position", "Lean.Data.OpenDecl", "Lean.Util.MonadCache", "Lean.MetavarContext", "Lean.Data.Json.Basic", "Lean.Data.Parsec", "Lean.Data.Json.Parser", "Lean.Data.Json.Printer", "Lean.Data.Json.FromToJson", "Lean.Data.Json.Stream", "Lean.Syntax", "Lean.Data.Json.Elab", "Lean.Data.Json", "Lean.Server.Rpc.Basic", "Lean.Widget.Types", "Lean.Elab.InfoTree.Types", "Lean.Util.PPExt", "Lean.Util.Sorry", "Lean.Message", "Lean.InternalExceptionId", "Lean.Exception", "Lean.Util.Trace", "Lean.Log", "Lean.Eval", "Lean.Modifiers", "Lean.ResolveName", "Lean.AuxRecursor", "Lean.Compiler.Old", "Lean.MonadEnv", "Lean.CoreM", "Lean.Attributes", "Lean.Class", "Lean.ReducibilityAttrs", "Lean.Util.MonadBacktrack", "Lean.Compiler.InlineAttrs", "Lean.Meta.TransparencyMode", "Lean.Meta.Basic", "Lean.Data.PrefixTree", "Lean.Data.NameTrie", "Lean.ScopedEnvExtension", "Lean.Meta.GlobalInstances", "Lean.Meta.GetUnfoldableConst", "Lean.Data.LBool", "Lean.Meta.InferType", "Lean.Meta.FunInfo", "Lean.Meta.LitValues", "Lean.Meta.CtorRecognizer", "Lean.Meta.Match.MatcherInfo", "Lean.Meta.Match.MatchPatternAttr", "Lean.Meta.WHNF", "Lean.Meta.Transform", "Lean.Meta.DiscrTreeTypes", "Lean.Meta.DiscrTree", "Lean.Util.CollectMVars", "Lean.Meta.CollectMVars", "Lean.Meta.Instances", "Lean.Meta.AbstractMVars", "Lean.Meta.Check", "Lean.Meta.SynthInstance", "Lean.Meta.DecLevel", "Lean.Meta.AppBuilder", "Lean.Meta.Coe", "Lean.Linter.Basic", "Lean.Meta.PPGoal", "Lean.Elab.InfoTree.Main", "Lean.Linter.Deprecated", "Lean.Elab.Config", "Lean.Data.Trie", "Lean.Parser.Types", "Lean.Parser.Basic", "Lean.Compiler.InitAttr", "Lean.DeclarationRange", "Lean.DocString", "Lean.Parser.Extension", "Lean.Parser.StrInterpolation", "Lean.ParserCompiler.Attribute", "Lean.Compiler.ExternAttr", "Lean.Compiler.IR.Basic", "Lean.Compiler.IR.Format", "Lean.Compiler.IR.CompilerM", "Lean.KeyedDeclsAttribute", "Lean.PrettyPrinter.Basic", "Lean.PrettyPrinter.Parenthesizer", "Lean.PrettyPrinter.Formatter", "Lean.Parser.Extra", "Lean.Parser.Level", "Lean.Elab.Exception", "Lean.Elab.AutoBound", "Lean.Elab.Level", "Lean.Parser.Attr", "Lean.Parser.Term", "Lean.Parser.Do", "Lean.Parser.Command", "Lean.Elab.Util", "Lean.Elab.Attributes", "Lean.Elab.DeclModifiers", "Lean.Elab.PreDefinition.WF.TerminationHint", "Lean.Elab.Term", "Lean.Elab.Tactic.Basic", "Lean.Util.ForEachExprWhere", "Lean.Meta.Tactic.Util", "Lean.Util.FindMVar", "Lean.Meta.Tactic.Apply", "Lean.Meta.Tactic.Constructor", "Lean.Meta.Tactic.FVarSubst", "Lean.Meta.Tactic.Intro", "Lean.Meta.Tactic.Clear", "Lean.Meta.Tactic.Revert", "Lean.Util.ForEachExpr", "Lean.Meta.Tactic.Assert", "Lean.Meta.Tactic.Rename", "Lean.Util.OccursCheck", "Lean.Elab.SyntheticMVars", "Lean.Elab.Tactic.ElabTerm", "Lean.Util.CollectFVars", "Lean.Meta.RecursorInfo", "Lean.Meta.Tactic.ElimInfo", "Lean.Meta.Tactic.Induction", "Lean.Meta.MatchUtil", "Lean.Meta.Tactic.Subst", "Lean.Meta.Tactic.Injection", "Lean.Meta.Tactic.Replace", "Lean.Meta.Tactic.UnifyEq", "Lean.Meta.ACLt", "Lean.Meta.Match.MatchEqsExt", "Lean.Meta.CongrTheorems", "Lean.Meta.Eqns", "Lean.Meta.Tactic.AuxLemma", "Lean.Meta.Tactic.Simp.SimpTheorems", "Lean.Meta.Tactic.Simp.SimpCongrTheorems", "Lean.Meta.Tactic.Simp.Types", "Lean.Meta.Tactic.LinearArith.Basic", "Lean.Meta.Offset", "Lean.HeadIndex", "Lean.Meta.KExprMap", "Lean.Meta.Tactic.LinearArith.Nat.Basic", "Lean.Meta.Tactic.LinearArith.Nat.Simp", "Lean.Meta.Tactic.LinearArith.Simp", "Lean.Meta.Tactic.Simp.Simproc", "Lean.Meta.Tactic.Simp.Attr", "Lean.Meta.Tactic.Simp.Rewrite", "Lean.Meta.Match.Value", "Lean.Meta.Tactic.Simp.Main", "Lean.Meta.Tactic.Acyclic", "Lean.Meta.Tactic.Cases", "Lean.Meta.GeneralizeVars", "Lean.Meta.KAbstract", "Lean.Elab.Quotation.Util", "Lean.Elab.Quotation.Precheck", "Lean.Elab.BindersUtil", "Lean.Elab.Binders", "Lean.Elab.Arg", "Lean.Elab.RecAppSyntax", "Lean.Elab.App", "Lean.Meta.Tactic.Generalize", "Lean.Elab.Tactic.Location", "Lean.Elab.Tactic.Generalize", "Lean.Elab.Tactic.Induction", "Lean.Meta.Tactic.Assumption", "Lean.Elab.Tactic.Injection", "Lean.Util.FoldConsts", "Lean.Meta.Closure", "Lean.Meta.Tactic.Contradiction", "Lean.Meta.GeneralizeTelescope", "Lean.Meta.CollectFVars", "Lean.Meta.Match.CaseValues", "Lean.Meta.Match.CaseArraySizes", "Lean.Meta.Match.Basic", "Lean.Meta.Match.MatcherApp.Basic", "Lean.Meta.Match.Match", "Lean.Meta.ForEachExpr", "Lean.Elab.MatchAltView", "Lean.Elab.PatternVar", "Lean.Elab.Match", "Lean.Elab.Tactic.Match", "Lean.Meta.Tactic.Rewrite", "Lean.Meta.Eval", "Lean.Meta.Tactic.Simp.RegisterCommand", "Lean.Elab.InfoTree", "Lean.Elab.SetOption", "Lean.Elab.Command", "Lean.PrettyPrinter.Delaborator.Options", "Lean.SubExpr", "Lean.PrettyPrinter.Delaborator.SubExpr", "Lean.Util.FindLevelMVar", "Lean.Util.CollectLevelParams", "Lean.Util.ReplaceLevel", "Lean.PrettyPrinter.Delaborator.TopDownAnalyze", "Lean.PrettyPrinter.Delaborator.Basic", "Lean.Parser.Tactic", "Lean.Parser.Module", "Lean.Parser.Syntax", "Lean.Parser", "Lean.Meta.CoeAttr", "Lean.PrettyPrinter.Delaborator.Builtins", "Lean.PrettyPrinter.Delaborator", "Lean.Meta.ReduceEval", "Lean.ParserCompiler", "Lean.PrettyPrinter", "Lean.Server.InfoUtils", "Lean.Linter.Util", "Lean.Linter.MissingDocs", "Lean.Elab.Tactic.Config", "Lean.Elab.Tactic.Rewrite", "Lean.Elab.Syntax", "Lean.Elab.MacroArgUtil", "Lean.Elab.AuxDef", "Lean.Elab.ElabRules", "Lean.Meta.Tactic.Simp.SimpAll", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Core", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Util", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Nat", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Fin", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.UInt", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Int", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.Char", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.String", "Lean.Meta.Tactic.Simp.BuiltinSimprocs.BitVec", "Lean.Meta.Tactic.Simp.BuiltinSimprocs", "Lean.Meta.Tactic.Simp", "Lean.Compiler.BorrowedAnnotation", "Lean.Compiler.ImplementedByAttr", "Lean.Elab.Eval", "Lean.Elab.BuiltinNotation", "Lean.Elab.Tactic.Simp", "Lean.Data.JsonRpc", "Lean.Data.Lsp.Basic", "Lean.Data.Lsp.TextSync", "Lean.Data.Lsp.LanguageFeatures", "Lean.Data.Lsp.Utf16", "Lean.Data.Lsp.Diagnostics", "Lean.Data.Lsp.CodeActions", "Lean.Data.Lsp.Capabilities", "Lean.Data.Lsp.Client", "Lean.Data.Lsp.Communication", "Lean.Data.Lsp.Extra", "Lean.Data.Lsp.Workspace", "Lean.Data.Lsp.InitShutdown", "Lean.Data.Lsp.Internal", "Lean.Data.Lsp.Ipc", "Lean.Data.Lsp", "Lean.Server.Utils", "Lean.Elab.Import", "Lean.Server.References", "Lean.Linter.UnusedVariables", "Lean.Widget.TaggedText", "Lean.Widget.Basic", "Lean.Widget.InteractiveCode", "Lean.Widget.InteractiveGoal", "Lean.Widget.InteractiveDiagnostic", "Lean.Server.Snapshots", "Lean.Server.AsyncList", "Lean.Server.FileWorker.Utils", "Lean.Server.FileSource", "Lean.Server.Requests", "Lean.Data.FuzzyMatching", "Lean.Meta.CompletionName", "Lean.Server.CompletionItemData", "Lean.Server.Completion", "Lean.Server.GoTo", "Lean.Widget.Diff", "Lean.Server.FileWorker.RequestHandling", "Lean.Server.CodeActions.Basic", "Lean.Server.CodeActions.Attr", "Lean.Elab.Open", "Lean.Elab.BuiltinTerm", "Lean.Server.CodeActions.Provider", "Lean.Server.CodeActions", "Lean.Server.Rpc.RequestHandling", "Lean.Widget.UserWidget", "Lean.Meta.Tactic.TryThis", "Lean.Elab.Tactic.SimpTrace", "Lean.Elab.Tactic.Simproc", "Lean.Meta.Reduce", "Lean.Meta.Tactic.Refl", "Lean.Elab.Do", "Lean.Elab.Tactic.BuiltinTactic", "Lean.LazyInitExtension", "Lean.Meta.Tactic.SplitIf", "Lean.Meta.Tactic.Split", "Lean.Elab.Tactic.Split", "Lean.Elab.Tactic.Conv.Basic", "Lean.Meta.Tactic.Congr", "Lean.Elab.Tactic.Conv.Congr", "Lean.Elab.Tactic.Conv.Rewrite", "Lean.Elab.Tactic.Conv.Change", "Lean.Elab.Tactic.Conv.Simp", "Lean.Elab.Tactic.Conv.Pattern", "Lean.Meta.Tactic.Delta", "Lean.Elab.Tactic.Delta", "Lean.Elab.Tactic.Conv.Delta", "Lean.Meta.Tactic.Unfold", "Lean.Elab.Tactic.Unfold", "Lean.Elab.Tactic.Conv.Unfold", "Lean.Elab.Tactic.Conv", "Lean.Elab.Tactic.Meta", "Lean.Elab.Tactic.Cache", "Lean.Elab.Calc", "Lean.Elab.Tactic.Calc", "Lean.Elab.Tactic.Congr", "Lean.Elab.Tactic.Guard", "Lean.Elab.Tactic.RCases", "Lean.Meta.Tactic.Repeat", "Lean.Elab.Tactic.Repeat", "Lean.Elab.Tactic.Ext", "Lean.Elab.Tactic.Change", "Lean.Elab.Tactic.FalseOrByContra", "Lean.Elab.Tactic.Omega.OmegaM", "Lean.Elab.Tactic.Omega.MinNatAbs", "Lean.Elab.Tactic.Omega.Core", "Lean.Elab.Tactic.Omega.Frontend", "Lean.Elab.Tactic.Omega", "Lean.Elab.Tactic.Simpa", "Lean.Meta.Tactic.NormCast", "Lean.Elab.Tactic.NormCast", "Lean.Meta.Tactic.Symm", "Lean.Elab.Tactic.Symm", "Lean.LabelAttribute", "Lean.Meta.Iterator", "Lean.Meta.Tactic.IndependentOf", "Lean.Meta.Tactic.Backtrack", "Lean.Meta.Tactic.SolveByElim", "Lean.Elab.Tactic.SolveByElim", "Lean.Meta.LazyDiscrTree", "Lean.Util.Heartbeats", "Lean.Meta.Tactic.LibrarySearch", "Lean.Elab.Tactic.LibrarySearch", "Lean.Elab.Tactic.ShowTerm", "Lean.Elab.Tactic", "Lean.Elab.DeclarationRange", "Lean.Compiler.NoncomputableAttr", "Std.CodeAction.Attr", "Std.CodeAction.Basic", "Std.Lean.Position", "Std.CodeAction.Deprecated", "Std.Tactic.Alias", "Std.Lean.Meta.Basic", "Std.Tactic.Init", "Std.Data.Nat.Basic", "Std.Data.Nat.Lemmas", "Std.Data.Array.Merge", "Std.Lean.Meta.Expr", "Std.Lean.PersistentHashMap", "Std.Lean.Meta.DiscrTree", "Mathlib.Mathport.Rename", "Mathlib.Init.Data.Nat.Notation", "Std.Data.Int.Order", "Mathlib.Init.Data.Int.Basic", "Std.Data.List.Basic", "Mathlib.Data.String.Defs", "Mathlib.Data.Array.Defs", "Mathlib.Lean.Expr.Traverse", "Mathlib.Util.MemoFix", "Mathlib.Lean.Expr.ReplaceRec", "Mathlib.Lean.EnvExtension", "Std.Tactic.OpenPrivate", "Mathlib.Lean.Meta.Simp", "Std.Lean.NameMapAttribute", "Std.Tactic.Lint.Basic", "Std.Tactic.Lint.Misc", "Std.Util.LibraryNote", "Std.Tactic.Lint.Simp", "Std.Tactic.Lint.TypeClass", "Lean.Util.Paths", "Std.Tactic.Lint.Frontend", "Std.Tactic.Lint", "Std.Tactic.Relation.Rfl", "Std.Logic", "Mathlib.Lean.Meta", "Mathlib.Lean.Elab.Tactic.Basic", "Mathlib.Tactic.Relation.Trans", "Mathlib.Tactic.Eqns", "Std.Lean.Expr", "Mathlib.Tactic.Simps.NotationClass", "Std.Data.Array.Match", "Std.Data.String.Basic", "Std.Lean.Name", "Std.Data.Nat.Gcd", "Std.Data.Int.DivMod", "Std.Data.Rat.Basic", "Mathlib.Lean.Expr.Basic", "Mathlib.Tactic.Simps.Basic", "Mathlib.Tactic.ToAdditive", "Mathlib.Init.ZeroOne", "Mathlib.Tactic.Lemma", "Lean.Data.Xml.Basic", "Lean.Data.Xml.Parser", "Lean.Data.Xml", "Lean.Data.Rat", "Lean.Data", "Lean.Compiler.Specialize", "Lean.Compiler.ConstFolding", "Lean.Compiler.ClosedTermCache", "Lean.Compiler.NeverExtractAttr", "Lean.Compiler.IR.FreeVars", "Lean.Compiler.IR.NormIds", "Lean.Compiler.IR.PushProj", "Lean.Compiler.IR.ElimDeadVars", "Lean.Compiler.IR.SimpCase", "Lean.Compiler.IR.LiveVars", "Lean.Compiler.IR.ResetReuse", "Lean.Compiler.IR.Checker", "Lean.Compiler.ExportAttr", "Lean.Compiler.IR.Borrow", "Lean.Runtime", "Lean.Compiler.IR.Boxing", "Lean.Compiler.IR.RC", "Lean.Compiler.IR.ExpandResetReuse", "Lean.Compiler.IR.UnboxResult", "Lean.Compiler.IR.ElimDeadBranches", "Lean.Compiler.NameMangling", "Lean.Compiler.IR.EmitUtil", "Lean.Compiler.IR.EmitC", "Lean.Compiler.IR.CtorLayout", "Lean.Compiler.IR.Sorry", "Lean.Compiler.IR", "Lean.Compiler.CSimpAttr", "Lean.Compiler.FFI", "Lean.Compiler.LCNF.Types", "Lean.Compiler.LCNF.Basic", "Lean.Compiler.LCNF.AlphaEqv", "Lean.Compiler.LCNF.LCtx", "Lean.Compiler.LCNF.ConfigOptions", "Lean.Compiler.LCNF.CompilerM", "Lean.Compiler.LCNF.PassManager", "Lean.Compiler.LCNF.PhaseExt", "Lean.Compiler.LCNF.BaseTypes", "Lean.Compiler.LCNF.Util", "Lean.Compiler.LCNF.MonoTypes", "Lean.Compiler.LCNF.OtherDecl", "Lean.Compiler.LCNF.InferType", "Lean.Compiler.LCNF.Bind", "Lean.Compiler.LCNF.Internalize", "Lean.Compiler.LCNF.PrettyPrinter", "Lean.Compiler.LCNF.CompatibleTypes", "Lean.Compiler.LCNF.Check", "Lean.Compiler.LCNF.ToExpr", "Lean.Compiler.LCNF.CSE", "Lean.Compiler.LCNF.DependsOn", "Lean.Compiler.LCNF.ElimDead", "Lean.Compiler.LCNF.FixedParams", "Lean.Compiler.LCNF.PullFunDecls", "Lean.Compiler.LCNF.FVarUtil", "Lean.Compiler.LCNF.ScopeM", "Lean.Compiler.LCNF.JoinPoints", "Lean.Compiler.LCNF.Level", "Lean.Compiler.Options", "Lean.Compiler.LCNF.PullLetDecls", "Lean.Compiler.LCNF.ReduceJpArity", "Lean.Compiler.LCNF.Renaming", "Lean.Compiler.LCNF.Simp.Basic", "Lean.Compiler.LCNF.Simp.FunDeclInfo", "Lean.Compiler.LCNF.Simp.DiscrM", "Lean.Compiler.LCNF.Simp.JpCases", "Lean.Compiler.LCNF.Simp.Config", "Lean.Compiler.LCNF.Simp.SimpM", "Lean.Compiler.LCNF.Simp.InlineCandidate", "Lean.Compiler.LCNF.Simp.InlineProj", "Lean.Compiler.LCNF.Simp.Used", "Lean.Compiler.LCNF.Simp.DefaultAlt", "Lean.Compiler.LCNF.Simp.SimpValue", "Lean.Compiler.LCNF.Simp.ConstantFold", "Lean.Compiler.LCNF.Simp.Main", "Lean.Compiler.LCNF.Simp", "Lean.Compiler.LCNF.SpecInfo", "Lean.Compiler.LCNF.MonadScope", "Lean.Compiler.LCNF.Closure", "Lean.Compiler.LCNF.Specialize", "Lean.Compiler.LCNF.ToMono", "Lean.Compiler.LCNF.DeclHash", "Lean.Compiler.LCNF.AuxDeclCache", "Lean.Compiler.LCNF.LambdaLifting", "Lean.Compiler.LCNF.FloatLetIn", "Lean.Compiler.LCNF.ReduceArity", "Lean.Compiler.LCNF.ElimDeadBranches", "Lean.Compiler.LCNF.Passes", "Lean.Compiler.LCNF.ToLCNF", "Lean.Compiler.LCNF.ToDecl", "Lean.Compiler.LCNF.Main", "Lean.Compiler.LCNF.Testing", "Lean.Compiler.LCNF.ForEachExpr", "Lean.Compiler.LCNF", "Lean.Compiler.Main", "Lean.Compiler.AtMostOnce", "Lean.Compiler", "Lean.Elab.BinderPredicates", "Lean.Elab.LetRec", "Lean.Elab.Frontend", "Lean.Elab.DeclUtil", "Lean.Elab.DefView", "Lean.Meta.Constructions", "Lean.Meta.SizeOf", "Lean.Meta.Injective", "Lean.Meta.IndPredBelow", "Lean.Meta.AbstractNestedProofs", "Lean.Elab.PreDefinition.Basic", "Lean.Meta.Match.MatchEqs", "Lean.Elab.PreDefinition.Eqns", "Lean.Elab.PreDefinition.WF.Eqns", "Lean.Elab.ComputedFields", "Lean.Elab.Deriving.Basic", "Lean.Elab.Inductive", "Lean.Meta.Structure", "Lean.Elab.Structure", "Lean.Util.SCC", "Lean.Elab.PreDefinition.Structural.Basic", "Lean.Elab.PreDefinition.Structural.FindRecArg", "Lean.Elab.PreDefinition.Structural.Preprocess", "Lean.Util.HasConstCache", "Lean.Meta.Match", "Lean.Meta.Match.MatcherApp.Transform", "Lean.Elab.PreDefinition.Structural.BRecOn", "Lean.Elab.PreDefinition.Structural.IndPred", "Lean.Elab.PreDefinition.Structural.Eqns", "Lean.Elab.PreDefinition.Structural.SmartUnfolding", "Lean.Elab.PreDefinition.Structural.Main", "Lean.Elab.PreDefinition.Structural", "Lean.Elab.PreDefinition.WF.PackDomain", "Lean.Elab.PreDefinition.WF.PackMutual", "Lean.Elab.PreDefinition.WF.Preprocess", "Lean.Elab.PreDefinition.WF.Rel", "Lean.Meta.Tactic.Cleanup", "Lean.Data.Array", "Lean.Elab.PreDefinition.WF.Fix", "Lean.Elab.PreDefinition.WF.Ite", "Lean.Elab.Quotation", "Lean.Elab.PreDefinition.WF.GuessLex", "Lean.Elab.PreDefinition.WF.Main", "Lean.Elab.PreDefinition.MkInhabitant", "Lean.Elab.PreDefinition.Main", "Lean.Elab.MutualDef", "Lean.Elab.Declaration", "Lean.Elab.StructInst", "Lean.Elab.Print", "Lean.Elab.PreDefinition.WF", "Lean.Elab.PreDefinition", "Lean.Elab.Deriving.Util", "Lean.Elab.Deriving.Inhabited", "Lean.Elab.Deriving.Nonempty", "Lean.Elab.Deriving.TypeName", "Lean.Elab.Deriving.BEq", "Lean.Meta.Inductive", "Lean.Elab.Deriving.DecEq", "Lean.Elab.Deriving.Repr", "Lean.Elab.Deriving.FromToJson", "Lean.Elab.Deriving.SizeOf", "Lean.Elab.Deriving.Hashable", "Lean.Elab.Deriving.Ord", "Lean.Elab.Deriving", "Lean.Elab.Extra", "Lean.Elab.GenInjective", "Lean.Elab.Macro", "Lean.Elab.Notation", "Lean.Elab.Mixfix", "Lean.Elab.MacroRules", "Lean.Elab.BuiltinCommand", "Lean.Elab.InheritDoc", "Lean.Elab.ParseImportsFast", "Lean.Elab.GuardMsgs", "Lean.Elab.CheckTactic", "Lean.Elab.MatchExpr", "Lean.Elab", "Lean.Meta.LevelDefEq", "Lean.Meta.UnificationHint", "Lean.Meta.ExprDefEq", "Lean.Meta.Tactic.LinearArith.Solver", "Lean.Meta.Tactic.LinearArith.Nat.Solver", "Lean.Meta.Tactic.LinearArith.Nat", "Lean.Meta.Tactic.LinearArith.Main", "Lean.Meta.Tactic.LinearArith", "Lean.Meta.Tactic.AC.Main", "Lean.Meta.Tactic.AC", "Lean.Meta.Tactic", "Lean.Meta.ExprLens", "Lean.Meta.ExprTraverse", "Lean.Meta", "Lean.Util.ShareCommon", "Lean.Util.TestExtern", "Lean.Util.LeanOptions", "Lean.Util.FileSetupInfo", "Lean.Util", "Lean.Server.Watchdog", "Lean.LoadDynlib", "Lean.Server.FileWorker.WidgetRequests", "Lean.Util.LakePath", "Lean.Server.FileWorker.SetupFile", "Lean.Server.ImportCompletion", "Lean.Server.FileWorker", "Lean.Server.Rpc.Deriving", "Lean.Server.Rpc", "Lean.Server", "Lean.Widget", "Lean.Linter.Builtin", "Lean.Linter", "Lean", "Std.Classes.BEq", "Std.Classes.Cast", "Std.Classes.Order", "Std.Classes.RatCast", "Std.Classes.SatisfiesM", "Std.CodeAction.Misc", "Std.CodeAction", "Std.Control.ForInStep.Basic", "Std.Control.ForInStep.Lemmas", "Std.Control.ForInStep", "Std.Control.Lemmas", "Std.Data.MLList.Basic", "Std.Control.Nondet.Basic", "Std.Data.List.Init.Attach", "Std.Data.Array.Basic", "Std.Data.Bool", "Std.Data.Fin.Basic", "Std.Data.Option.Lemmas", "Std.Data.List.Lemmas", "Std.Tactic.SeqFocus", "Std.Util.ProofWanted", "Std.Data.Array.Lemmas", "Std.Data.Array.Monadic", "Std.Data.Array", "Std.Data.AssocList", "Std.Data.BinomialHeap.Basic", "Std.Data.BinomialHeap.Lemmas", "Std.Data.BinomialHeap", "Std.Data.Fin.Lemmas", "Std.Data.BitVec.Lemmas", "Std.Data.BitVec", "Std.Data.ByteArray", "Std.Data.Char", "Std.Data.DList", "Std.Data.Fin", "Std.Data.HashMap.Basic", "Std.Data.HashMap.Lemmas", "Std.Data.HashMap.WF", "Std.Data.HashMap", "Std.Data.Int.Gcd", "Std.Data.Int.Lemmas", "Std.Data.Int", "Std.Data.LazyList", "Std.Data.List.Count", "Std.Data.List.Pairwise", "Std.Data.List.Perm", "Std.Data.List", "Std.Data.MLList.Heartbeats", "Std.Lean.System.IO", "Std.Data.MLList.IO", "Std.Data.MLList", "Std.Data.Nat", "Std.Data.Option", "Std.Data.PairingHeap", "Std.Data.RBMap.Basic", "Std.Data.RBMap.WF", "Std.Data.RBMap.Alter", "Std.Data.RBMap.Lemmas", "Std.Data.RBMap", "Std.Data.Range.Lemmas", "Std.Data.Range", "Std.Data.Rat.Lemmas", "Std.Data.Rat", "Std.Data.String.Lemmas", "Std.Data.String", "Std.Data.Sum.Basic", "Std.Data.Sum.Lemmas", "Std.Data.Sum", "Std.Data.UInt", "Std.Data.UnionFind.Basic", "Std.Data.UnionFind.Lemmas", "Std.Data.UnionFind", "Std.Lean.TagAttribute", "Std.Lean.AttributeExtra", "Std.Lean.Delaborator", "Std.Lean.Except", "Std.Lean.Float", "Std.Lean.HashMap", "Std.Lean.HashSet", "Std.Lean.IO.Process", "Std.Lean.Json", "Std.Lean.Meta.AssertHypotheses", "Std.Lean.Meta.Clear", "Std.Lean.Meta.Inaccessible", "Std.Lean.Meta.InstantiateMVars", "Std.Lean.MonadBacktrack", "Std.Lean.Meta.SavedState", "Std.Lean.Meta.Simp", "Std.Lean.Meta.UnusedNames", "Std.Lean.NameMap", "Std.Lean.PersistentHashSet", "Std.Lean.SMap", "Std.Lean.Syntax", "Std.Lean.Util.EnvSearch", "Std.Lean.Util.Path", "Std.Tactic.Unreachable", "Std.Linter.UnreachableTactic", "Std.Linter.UnnecessarySeqFocus", "Std.Linter", "Std.Tactic.Basic", "Std.Tactic.Case", "Std.Tactic.Classical", "Std.Tactic.Congr", "Std.Tactic.Exact", "Std.Tactic.FalseOrByContra", "Std.Tactic.Instances", "Std.Tactic.NoMatch", "Std.Tactic.PermuteGoals", "Std.Tactic.PrintDependents", "Std.Tactic.PrintPrefix", "Std.Tactic.SqueezeScope", "Std.Tactic.Where", "Std.Test.Internal.DummyLabelAttr", "Std.Util.Cache", "Std.Util.CheckTactic", "Std.Util.ExtendedBinder", "Std.Util.Pickle", "Std.WF", "Std", "Mathlib.Tactic.PPWithUniv", "Mathlib.Tactic.ExtendDoc", "Mathlib.Tactic.TypeStar", "Mathlib.Util.AssertExists", "Mathlib.Algebra.Group.Defs", "Mathlib.Tactic.Basic", "Mathlib.Tactic.Attr.Register", "Mathlib.Init.Function", "Mathlib.Logic.Nonempty", "Mathlib.Init.Set", "Mathlib.Mathport.Attributes", "Mathlib.Tactic.ProjectionNotation", "Mathlib.Init.Logic", "Mathlib.Init.Algebra.Classes", "Mathlib.Logic.Basic", "Mathlib.Logic.Function.Basic", "Mathlib.Logic.Nontrivial.Defs", "Mathlib.Tactic.Core", "Mathlib.Tactic.SplitIfs", "Mathlib.Algebra.GroupWithZero.Defs", "Mathlib.Data.Nat.Cast.Defs", "Mathlib.Data.Int.Cast.Defs", "Mathlib.Tactic.Spread", "Mathlib.Algebra.Ring.Defs", "Mathlib.Data.Rat.Init", "Mathlib.Algebra.Field.Defs", "Mathlib.Algebra.Invertible.Defs", "Mathlib.Init.Data.Ordering.Basic", "Mathlib.Init.Order.Defs", "Mathlib.Algebra.NeZero", "Mathlib.Algebra.GroupWithZero.NeZero", "Mathlib.Algebra.Invertible.GroupWithZero", "Mathlib.Data.Sigma.Basic", "Mathlib.Tactic.Inhabit", "Mathlib.Data.Prod.Basic", "Mathlib.Lean.Name", "Mathlib.Tactic.MkIffOfInductiveProp", "Mathlib.Data.Sum.Basic", "Mathlib.Logic.IsEmpty", "Mathlib.Logic.Unique", "Mathlib.Algebra.Group.Pi.Basic", "Mathlib.Util.CompileInductive", "Mathlib.Data.FunLike.Basic", "Mathlib.Algebra.Group.Hom.Defs", "Mathlib.Data.FunLike.Embedding", "Mathlib.Data.FunLike.Equiv", "Mathlib.Init.Data.Quot", "Mathlib.Logic.Relator", "Mathlib.Lean.Elab.Term", "Mathlib.Lean.PrettyPrinter.Delaborator", "Mathlib.Util.WithWeakNamespace", "Mathlib.Tactic.ScopedNS", "Mathlib.Mathport.Notation", "Mathlib.Data.Quot", "Mathlib.Tactic.Coe", "Mathlib.Init.Data.Bool.Lemmas", "Mathlib.Tactic.Substs", "Mathlib.Tactic.Conv", "Mathlib.Logic.Equiv.Defs", "Mathlib.Data.Finite.Defs", "Mathlib.Data.Subtype", "Mathlib.Logic.Nontrivial.Basic", "Mathlib.Algebra.Group.TypeTags", "Mathlib.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Basic", "Mathlib.Init.Data.Nat.Lemmas", "Aesop.Check", "Aesop.Nanos", "Aesop.Util.UnionFind", "Aesop.Util.UnorderedArraySet", "Aesop.Util.Basic", "Aesop.Rule.Name", "Aesop.Tracing", "Aesop.RulePattern", "Aesop.Index.Basic", "Aesop.Options.Public", "Aesop.Options.Internal", "Aesop.Options", "Aesop.Percent", "Aesop.Util.Tactic", "Aesop.Util.EqualUpToIds", "Aesop.Script", "Aesop.RuleTac.Basic", "Aesop.Rule.Basic", "Aesop.Index", "Aesop.Rule", "Aesop.RuleSet.Member", "Aesop.RuleSet.Name", "Aesop.RuleSet.Filter", "Aesop.RuleSet", "Aesop.Frontend.Extension.Init", "Aesop.Frontend.Extension", "Aesop.ElabM", "Aesop.Frontend.Basic", "Aesop.RuleTac.ElabRuleTerm", "Aesop.Builder.Basic", "Aesop.Builder.Apply", "Aesop.RuleTac.Cases", "Aesop.Builder.Cases", "Aesop.Builder.Constructors", "Aesop.Builder.NormSimp", "Aesop.Builder.Tactic", "Aesop.Builder.Default", "Aesop.Builder.Forward", "Aesop.Builder.Unfold", "Aesop.Builder", "Aesop.Frontend.RuleExpr", "Aesop.Frontend.Attribute", "Aesop.RuleTac.Apply", "Aesop.RuleTac.Forward", "Aesop.RuleTac.Preprocess", "Aesop.RuleTac.Tactic", "Aesop.RuleTac", "Aesop.Search.Expansion.Basic", "Aesop.Search.Expansion.Simp", "Aesop.Constants", "Aesop.Tree.UnsafeQueue", "Aesop.Tree.Data", "Aesop.Tree.Traversal", "Aesop.Tree.RunMetaM", "Aesop.Tree.TreeM", "Aesop.Tree.AddRapp", "Aesop.Tree.State", "Aesop.Tree.Check", "Lean.Replay", "Aesop.Tree.Tracing", "Aesop.Tree.ExtractProof", "Aesop.Tree.ExtractScript", "Aesop.Tree.Free", "Aesop.Tree", "Aesop.Search.Queue.Class", "Aesop.Stats.Basic", "Aesop.Search.SearchM", "Aesop.Search.RuleSelection", "Aesop.Search.Expansion.Norm", "Aesop.Search.Expansion", "Aesop.Exception", "Aesop.Search.ExpandSafePrefix", "Aesop.Search.Queue", "Aesop.Search.Main", "Aesop.BuiltinRules.Assumption", "Aesop.BuiltinRules.ApplyHyps", "Aesop.BuiltinRules.DestructProducts", "Aesop.BuiltinRules.Ext", "Aesop.BuiltinRules.Intros", "Aesop.BuiltinRules.Split", "Aesop.BuiltinRules.Subst", "Aesop.Stats.Extension", "Aesop.Stats.Report", "Aesop.Frontend.Command", "Aesop.Frontend.Tactic", "Aesop.Frontend", "Aesop.BuiltinRules", "Aesop.Main", "Aesop", "Mathlib.Tactic.Cases", "Mathlib.Tactic.SimpRw", "Mathlib.Algebra.Group.Basic", "Mathlib.Data.Int.Cast.Basic", "Qq.ForLean.ReduceEval", "Qq.ForLean.ToExpr", "Qq.Typ", "Qq.Macro", "Qq.Delab", "Qq.MetaM", "Mathlib.Tactic.NormNum.Result", "Qq.ForLean.Do", "Qq.SortLocalDecls", "Qq.Match", "Qq.AssertInstancesCommute", "Qq", "Mathlib.Util.Qq", "Mathlib.Tactic.NormNum.Core", "Mathlib.Tactic.HaveI", "Mathlib.Init.Order.LinearOrder", "Mathlib.Lean.Meta.CongrTheorems", "Mathlib.Tactic.Relation.Rfl", "Mathlib.Tactic.Congr!", "Mathlib.Tactic.Convert", "Mathlib.Order.Notation", "Mathlib.Order.Basic", "Mathlib.Order.Synonym", "Mathlib.Algebra.Group.OrderSynonym", "Mathlib.Algebra.GroupWithZero.Basic", "Mathlib.Algebra.Group.Semiconj.Defs", "Mathlib.Tactic.GCongr.ForwardAttr", "Mathlib.Tactic.GCongr.Core", "Mathlib.Tactic.PushNeg", "Mathlib.Tactic.Use", "Mathlib.Data.Nat.Defs", "Mathlib.Algebra.Group.Commute.Defs", "Mathlib.Algebra.Group.Semiconj.Basic", "Mathlib.Algebra.Group.Commute.Basic", "Mathlib.Data.Int.Defs", "ImportGraph.RequiredModules", "ImportGraph.Imports", "Mathlib.Tactic.ApplyCongr", "Mathlib.Lean.Meta.Basic", "Mathlib.Tactic.ApplyAt", "Mathlib.Tactic.ApplyWith", "Mathlib.Tactic.ByContra", "Mathlib.Tactic.CasesM", "Mathlib.Tactic.Check", "Mathlib.Util.Tactic", "Mathlib.Tactic.Choose", "Mathlib.Tactic.Clear!", "Mathlib.Tactic.ClearExcept", "Mathlib.Tactic.Clear_", "Mathlib.Tactic.TermCongr", "Mathlib.Tactic.Congrm", "Mathlib.Tactic.Constructor", "Mathlib.Tactic.Contrapose", "Mathlib.Tactic.DefEqTransformations", "Mathlib.Tactic.ToLevel", "Mathlib.Tactic.DeriveToExpr", "Mathlib.Tactic.Existsi", "Mathlib.Tactic.ExtractGoal", "Mathlib.Tactic.ExtractLets", "Mathlib.Tactic.FailIfNoProgress", "Mathlib.Tactic.Find", "Mathlib.Tactic.GeneralizeProofs", "Mathlib.Tactic.GuardGoalNums", "Mathlib.Tactic.GuardHypNums", "Mathlib.Tactic.HelpCmd", "Mathlib.Tactic.HigherOrder", "Mathlib.Tactic.Hint", "Mathlib.Tactic.InferParam", "Mathlib.Tactic.IrreducibleDef", "Mathlib.Tactic.Lift", "Mathlib.Tactic.Lint", "Mathlib.Tactic.NthRewrite", "Mathlib.Tactic.Observe", "Mathlib.Tactic.Propose", "Mathlib.Tactic.RSuffices", "Mathlib.Tactic.Recover", "Mathlib.Tactic.Rename", "Mathlib.Tactic.RenameBVar", "Mathlib.Init.Core", "Mathlib.Init.Control.Combinators", "Mathlib.Tactic.Attr.Core", "Mathlib.Control.Basic", "Mathlib.Data.MLList.Dedup", "Mathlib.Lean.Meta.DiscrTree", "Mathlib.Tactic.Rewrites", "Mathlib.Tactic.Says", "Mathlib.Tactic.Set", "Mathlib.Tactic.SimpIntro", "Mathlib.Tactic.SuccessIfFailWithMsg", "Mathlib.Tactic.SudoSetOption", "Mathlib.Tactic.SwapVar", "Mathlib.Tactic.Tauto", "Mathlib.Util.WhatsNew", "Mathlib.Tactic.ToExpr", "Mathlib.Tactic.Trace", "Mathlib.Tactic.TypeCheck", "Mathlib.Tactic.UnsetOption", "Mathlib.Tactic.Variable", "ProofWidgets.Compat", "ProofWidgets.Component.Basic", "ProofWidgets.Component.MakeEditLink", "ProofWidgets.Data.Html", "ProofWidgets.Cancellable", "ProofWidgets.Component.OfRpcMethod", "Mathlib.Tactic.Widget.SelectInsertParamsClass", "Mathlib.Tactic.Widget.SelectPanelUtils", "Mathlib.Tactic.Widget.Calc", "Mathlib.Tactic.Widget.Congrm", "Mathlib.Tactic.Widget.Conv", "Mathlib.Tactic.WLOG", "Mathlib.Util.CountHeartbeats", "Mathlib.Tactic.Common", "Mathlib.Algebra.GroupPower.Basic", "Mathlib.Tactic.Nontriviality.Core", "Mathlib.Tactic.Nontriviality", "Mathlib.Algebra.Group.Units", "Mathlib.Algebra.GroupWithZero.Units.Basic", "Mathlib.Algebra.Group.Semiconj.Units", "Mathlib.Init.Classical", "Mathlib.Algebra.GroupWithZero.Semiconj", "Mathlib.Algebra.Group.Commute.Units", "Mathlib.Algebra.GroupWithZero.Commute", "Mathlib.Algebra.Ring.Semiconj", "Mathlib.Algebra.Opposites", "Mathlib.Algebra.Group.InjSurj", "Mathlib.Algebra.GroupWithZero.InjSurj", "Mathlib.Algebra.Ring.InjSurj", "Mathlib.Algebra.Group.Units.Hom", "Mathlib.Algebra.Group.Hom.Basic", "Mathlib.Data.Bool.Basic", "Mathlib.Data.Option.Defs", "Mathlib.Init.Data.Sigma.Basic", "Mathlib.Logic.Function.Conjugate", "Mathlib.Logic.Equiv.Basic", "Mathlib.Algebra.Group.Equiv.Basic", "Mathlib.Algebra.GroupWithZero.Hom", "Mathlib.Algebra.Ring.Basic", "Mathlib.Algebra.Ring.Hom.Defs", "Mathlib.Algebra.Ring.Units", "Mathlib.Data.Bracket", "Mathlib.Algebra.Ring.Commute", "Mathlib.Data.Nat.Cast.Commute", "Mathlib.Logic.Function.Iterate", "Mathlib.Init.Data.Int.Order", "Mathlib.Order.Compare", "Mathlib.Order.Max", "Mathlib.Init.Propext", "Mathlib.Logic.Relation", "Mathlib.Order.RelClasses", "Mathlib.Order.Monotone.Basic", "Mathlib.Data.Int.Basic", "Mathlib.Algebra.Invertible.Basic", "Mathlib.Algebra.Divisibility.Basic", "Mathlib.Data.Nat.Cast.Basic", "Mathlib.Tactic.NormNum.Basic", "Mathlib.Data.Option.Basic", "Mathlib.Data.Prod.PProd", "Mathlib.Logic.Embedding.Basic", "Mathlib.GroupTheory.GroupAction.Defs", "Mathlib.GroupTheory.GroupAction.Units", "Mathlib.Algebra.GroupWithZero.Units.Lemmas", "Mathlib.Algebra.CovariantAndContravariant", "Mathlib.Order.ULift", "Mathlib.Order.Lattice", "Mathlib.Order.MinMax", "Mathlib.Algebra.Order.Monoid.Lemmas", "Mathlib.Order.BoundedOrder", "Mathlib.Algebra.Order.Monoid.Defs", "Mathlib.Algebra.Order.Sub.Defs", "Mathlib.Algebra.Order.Group.Defs", "Mathlib.Algebra.Order.Monoid.Canonical.Defs", "Mathlib.Algebra.Order.Monoid.MinMax", "Mathlib.Algebra.Order.ZeroLEOne", "Mathlib.Algebra.Order.Monoid.NatCast", "Mathlib.Algebra.Order.Ring.Lemmas", "Mathlib.Algebra.Order.Ring.Defs", "Mathlib.Algebra.Order.Field.Defs", "Mathlib.Data.Option.NAry", "Mathlib.Algebra.Group.WithOne.Defs", "Mathlib.Algebra.Group.Units.Equiv", "Mathlib.Algebra.GroupWithZero.Units.Equiv", "Mathlib.Control.EquivFunctor", "Mathlib.Logic.Equiv.Option", "Mathlib.Order.RelIso.Basic", "Mathlib.Order.Disjoint", "Mathlib.Order.WithBot", "Mathlib.Tactic.Monotonicity.Attr", "Mathlib.Order.Hom.Basic", "Mathlib.Algebra.Order.Monoid.Units", "Mathlib.Algebra.Order.Group.Units", "Mathlib.Algebra.Order.Monoid.Basic", "Mathlib.Algebra.Order.Monoid.OrderDual", "Mathlib.Algebra.Order.Monoid.TypeTags", "Mathlib.Algebra.Order.Monoid.WithZero", "Mathlib.Algebra.Order.Sub.Canonical", "Mathlib.Algebra.Order.Ring.Canonical", "Mathlib.Data.Nat.Order.Basic", "Mathlib.Algebra.GroupPower.CovariantClass", "Mathlib.Algebra.Order.Group.OrderIso", "Mathlib.Algebra.Order.Group.Lattice", "Mathlib.Algebra.Order.Group.Abs", "Mathlib.Algebra.CharZero.Defs", "Mathlib.Algebra.Order.Ring.CharZero", "Mathlib.Data.Int.Order.Basic", "Mathlib.Data.Rat.Defs", "Mathlib.Tactic.FBinop", "Mathlib.Data.SProd", "Mathlib.Data.Set.Defs", "Mathlib.Order.PropInstances", "Mathlib.Order.Heyting.Basic", "Mathlib.Order.BooleanAlgebra", "Mathlib.Order.SymmDiff", "Mathlib.Util.Delaborators", "Mathlib.Data.Set.Basic", "Mathlib.Algebra.Ring.Hom.Basic", "Mathlib.Data.Nat.Cast.NeZero", "Mathlib.Data.Nat.Cast.Order", "Mathlib.Data.Int.Cast.Lemmas", "Mathlib.Data.Rat.Order", "Mathlib.Data.Rat.Field", "Mathlib.Algebra.Ring.Divisibility.Basic", "Mathlib.Data.Int.Dvd.Basic", "Mathlib.Data.Nat.Units", "Mathlib.Algebra.Divisibility.Units", "Mathlib.Algebra.GroupWithZero.Divisibility", "Mathlib.Data.Nat.Order.Lemmas", "Mathlib.Algebra.Regular.Basic", "Mathlib.Algebra.Ring.Regular", "Mathlib.Data.Int.Div", "Mathlib.Data.PNat.Defs", "Mathlib.Data.Rat.Lemmas", "Mathlib.Data.Rat.Cast.Defs", "Mathlib.Tactic.NormNum.OfScientific", "Mathlib.Algebra.Group.Opposite", "Mathlib.Algebra.Group.Prod", "Mathlib.Data.Set.Intervals.Basic", "Mathlib.Data.Set.Image", "Mathlib.Data.Set.Prod", "Mathlib.Data.Set.Function", "Mathlib.Order.Directed", "Mathlib.Data.Set.Intervals.Image", "Mathlib.Data.Set.NAry", "Mathlib.Order.Bounds.Basic", "Mathlib.Data.Set.Intervals.UnorderedInterval", "Mathlib.Data.Set.Intervals.OrderEmbedding", "Mathlib.Logic.Pairwise", "Mathlib.Data.Set.Pairwise.Basic", "Mathlib.Logic.Equiv.Set", "Mathlib.Order.Hom.Set", "Mathlib.Order.Antichain", "Mathlib.Order.SetNotation", "Mathlib.Data.Set.Intervals.OrdConnected", "Mathlib.Order.Antisymmetrization", "Mathlib.Order.Cover", "Mathlib.Algebra.Function.Support", "Mathlib.Data.Int.Cast.Field", "Mathlib.Data.Int.CharZero", "Mathlib.Data.Rat.Cast.CharZero", "Mathlib.Algebra.Field.Basic", "Mathlib.Tactic.NormNum.Inv", "Mathlib.Tactic.NormNum.Eq", "Mathlib.Algebra.Order.Monoid.WithTop", "Mathlib.Algebra.Order.Invertible", "Mathlib.Tactic.NormNum.Ineq", "Mathlib.Algebra.GroupPower.Hom", "Mathlib.Algebra.GroupPower.Ring", "Mathlib.Tactic.NormNum.Pow", "Mathlib.Tactic.NormNum.DivMod", "Mathlib.Tactic.Positivity.Core", "Mathlib.Data.Rat.Cast.Order", "Mathlib.Tactic.NormNum", "Mathlib.Util.AtomM", "Mathlib.Tactic.Abel", "Mathlib.Tactic.ApplyFun", "Mathlib.Tactic.ArithMult.Init", "Mathlib.Tactic.ArithMult", "Mathlib.Init.Data.Nat.Bitwise", "Mathlib.Data.Num.Basic", "Mathlib.Data.Tree", "Mathlib.Util.SynthesizeUsing", "Mathlib.Tactic.CancelDenoms.Core", "Mathlib.Tactic.CancelDenoms", "Mathlib.CategoryTheory.Category.Init", "Mathlib.Data.Opposite", "Mathlib.Combinatorics.Quiver.Basic", "Mathlib.CategoryTheory.Category.Basic", "Mathlib.CategoryTheory.Functor.Basic", "Mathlib.Util.AddRelatedDecl", "Mathlib.Tactic.CategoryTheory.Reassoc", "Mathlib.CategoryTheory.NatTrans", "Mathlib.CategoryTheory.Iso", "Mathlib.CategoryTheory.Functor.Category", "Mathlib.CategoryTheory.NatIso", "Mathlib.CategoryTheory.Bicategory.Basic", "Mathlib.CategoryTheory.Bicategory.Functor", "Mathlib.CategoryTheory.Bicategory.Free", "Mathlib.Tactic.CategoryTheory.BicategoryCoherence", "Mathlib.CategoryTheory.Functor.FullyFaithful", "Mathlib.CategoryTheory.FullSubcategory", "Mathlib.CategoryTheory.Whiskering", "Mathlib.CategoryTheory.EssentialImage", "Mathlib.Tactic.CategoryTheory.Slice", "Mathlib.CategoryTheory.Equivalence", "Mathlib.CategoryTheory.Opposites", "Mathlib.CategoryTheory.EqToHom", "Mathlib.CategoryTheory.Functor.Const", "Mathlib.CategoryTheory.Products.Basic", "Mathlib.CategoryTheory.Monoidal.Category", "Mathlib.CategoryTheory.Adjunction.Basic", "Mathlib.CategoryTheory.Monoidal.Functor", "Mathlib.CategoryTheory.Monoidal.Free.Basic", "Mathlib.Tactic.CategoryTheory.MonoidalComp", "Mathlib.Tactic.CategoryTheory.Coherence", "Mathlib.CategoryTheory.Pi.Basic", "Mathlib.Logic.Lemmas", "Mathlib.Combinatorics.Quiver.Path", "Mathlib.Combinatorics.Quiver.Push", "Mathlib.Combinatorics.Quiver.Symmetric", "Mathlib.CategoryTheory.Groupoid", "Mathlib.CategoryTheory.EpiMono", "Mathlib.CategoryTheory.Types", "Mathlib.CategoryTheory.Balanced", "Mathlib.CategoryTheory.Comma.Basic", "Mathlib.CategoryTheory.Comma.Arrow", "Mathlib.CategoryTheory.CommSq", "Mathlib.CategoryTheory.LiftingProperties.Basic", "Mathlib.CategoryTheory.Limits.Shapes.StrongEpi", "Mathlib.CategoryTheory.LiftingProperties.Adjunction", "Mathlib.CategoryTheory.Functor.EpiMono", "Mathlib.Control.ULift", "Mathlib.Data.ULift", "Mathlib.CategoryTheory.DiscreteCategory", "Mathlib.CategoryTheory.Functor.Hom", "Mathlib.CategoryTheory.Functor.Currying", "Mathlib.CategoryTheory.Yoneda", "Mathlib.CategoryTheory.Functor.ReflectsIso", "Mathlib.CategoryTheory.Limits.Cones", "Mathlib.CategoryTheory.Limits.IsLimit", "Mathlib.CategoryTheory.Category.ULift", "Mathlib.CategoryTheory.Category.Preorder", "Mathlib.CategoryTheory.ConcreteCategory.Bundled", "Mathlib.CategoryTheory.Bicategory.Strict", "Mathlib.CategoryTheory.Category.Cat", "Mathlib.CategoryTheory.IsomorphismClasses", "Mathlib.CategoryTheory.Thin", "Mathlib.CategoryTheory.Skeletal", "Mathlib.Logic.Small.Defs", "Mathlib.Logic.UnivLE", "Mathlib.Logic.Small.Basic", "Mathlib.CategoryTheory.EssentiallySmall", "Mathlib.CategoryTheory.Limits.HasLimits", "Mathlib.CategoryTheory.Limits.Shapes.WidePullbacks", "Mathlib.CategoryTheory.PUnit", "Mathlib.CategoryTheory.PEmpty", "Mathlib.CategoryTheory.Limits.Shapes.Terminal", "Mathlib.Data.Bool.Set", "Mathlib.Data.Nat.Set", "Mathlib.Order.CompleteLattice", "Mathlib.Order.CompleteBooleanAlgebra", "Mathlib.Order.GaloisConnection", "Mathlib.Data.Set.Lattice", "Mathlib.Logic.Small.Set", "Mathlib.CategoryTheory.Comma.StructuredArrow", "Mathlib.CategoryTheory.Comma.Over", "Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts", "Mathlib.CategoryTheory.Limits.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Preserves.Basic", "Mathlib.CategoryTheory.Limits.Preserves.Shapes.Pullbacks", "Mathlib.CategoryTheory.Limits.Constructions.EpiMono", "Mathlib.CategoryTheory.ConcreteCategory.Basic", "Mathlib.Tactic.CategoryTheory.Elementwise", "Mathlib.Tactic.Change", "Mathlib.Tactic.Clean", "Mathlib.Algebra.GroupPower.Order", "Mathlib.Algebra.Order.Ring.Abs", "Mathlib.Order.Bounds.OrderIso", "Mathlib.Algebra.Order.Field.Basic", "Mathlib.Data.Nat.Cast.Field", "Mathlib.Algebra.CharZero.Lemmas", "Mathlib.Algebra.Group.Hom.Instances", "Mathlib.Algebra.Group.Pi.Lemmas", "Mathlib.Algebra.Function.Indicator", "Mathlib.Algebra.Ring.Opposite", "Mathlib.GroupTheory.GroupAction.Opposite", "Mathlib.GroupTheory.GroupAction.Prod", "Mathlib.Algebra.SMulWithZero", "Mathlib.Algebra.Order.Group.InjSurj", "Mathlib.Algebra.Order.Ring.InjSurj", "Mathlib.Order.WellFounded", "Mathlib.Order.ConditionallyCompleteLattice.Basic", "Mathlib.Order.LatticeIntervals", "Mathlib.Order.CompleteLatticeIntervals", "Mathlib.Algebra.Order.Nonneg.Ring", "Mathlib.Control.Functor", "Mathlib.Data.List.Defs", "Mathlib.Init.Data.List.Basic", "Mathlib.Data.List.GetD", "Mathlib.Data.Nat.Bits", "Mathlib.Data.Nat.Bitwise", "Mathlib.Data.Nat.Size", "Mathlib.Init.Data.Int.Bitwise", "Mathlib.Data.Int.Bitwise", "Mathlib.Data.Int.Order.Lemmas", "Mathlib.Data.Int.Lemmas", "Mathlib.Data.NNRat.Defs", "Mathlib.Algebra.GroupPower.IterateHom", "Mathlib.GroupTheory.Perm.Basic", "Mathlib.Algebra.Group.Aut", "Mathlib.GroupTheory.GroupAction.Group", "Mathlib.GroupTheory.GroupAction.Pi", "Mathlib.Algebra.Module.Basic", "Mathlib.Algebra.Regular.SMul", "Mathlib.Algebra.Field.IsField", "Mathlib.Algebra.Ring.Equiv", "Mathlib.Algebra.Ring.CompTypeclasses", "Mathlib.Algebra.Ring.Pi", "Mathlib.Algebra.Module.Pi", "Mathlib.Algebra.Field.Opposite", "Mathlib.Algebra.GroupRingAction.Basic", "Mathlib.Algebra.Ring.Aut", "Mathlib.Tactic.SetLike", "Mathlib.Data.SetLike.Basic", "Mathlib.Algebra.Star.Basic", "Mathlib.GroupTheory.GroupAction.DomAct.Basic", "Mathlib.GroupTheory.GroupAction.Hom", "Mathlib.Algebra.Module.LinearMap.Basic", "Mathlib.Algebra.Module.LinearMap.End", "Mathlib.Algebra.Module.Equiv", "Mathlib.Algebra.Group.Embedding", "Mathlib.Data.Fin.Basic", "Mathlib.Data.Finset.Attr", "Mathlib.Init.Data.List.Instances", "Mathlib.Init.Data.List.Lemmas", "Mathlib.Data.List.Basic", "Mathlib.Data.List.Infix", "Mathlib.Data.List.Forall2", "Mathlib.Data.List.Lex", "Mathlib.Data.List.Chain", "Mathlib.Init.Data.Fin.Basic", "Mathlib.Data.List.Nodup", "Mathlib.Data.List.Zip", "Mathlib.Data.List.Pairwise", "Mathlib.Data.List.Range", "Mathlib.Data.Set.List", "Mathlib.Data.List.Dedup", "Mathlib.Algebra.BigOperators.List.Defs", "Mathlib.Data.List.ProdSigma", "Mathlib.Data.List.Rotate", "Mathlib.Algebra.BigOperators.List.Basic", "Mathlib.Data.List.Join", "Mathlib.Data.List.Permutation", "Mathlib.Data.List.InsertNth", "Mathlib.Data.List.Lattice", "Mathlib.Data.Nat.Factorial.Basic", "Mathlib.Data.List.Count", "Mathlib.Data.List.Perm", "Mathlib.Init.Quot", "Mathlib.Data.Multiset.Basic", "Mathlib.Data.Multiset.Range", "Mathlib.Data.Multiset.Nodup", "Mathlib.Data.Multiset.Dedup", "Mathlib.Data.Multiset.FinsetOps", "Mathlib.Data.Finset.Basic", "Mathlib.Algebra.BigOperators.Multiset.Basic", "Mathlib.Data.Multiset.Bind", "Mathlib.Data.Finset.Union", "Mathlib.Data.Finset.Image", "Mathlib.Data.Fin.OrderHom", "Mathlib.Data.Fintype.Basic", "Mathlib.Data.Finset.Card", "Mathlib.Data.Pi.Lex", "Mathlib.Data.Fin.Tuple.Basic", "Mathlib.Data.List.OfFn", "Mathlib.Data.List.Sort", "Mathlib.Data.List.Duplicate", "Mathlib.Data.List.NodupEquivFin", "Mathlib.Data.Fintype.Card", "Mathlib.Data.Setoid.Basic", "Mathlib.Data.Set.Pointwise.Basic", "Mathlib.Data.Set.Pointwise.SMul", "Mathlib.Algebra.Group.Conj", "Mathlib.GroupTheory.Subsemigroup.Basic", "Mathlib.GroupTheory.Subsemigroup.Operations", "Mathlib.GroupTheory.Subsemigroup.Center", "Mathlib.GroupTheory.Subsemigroup.Centralizer", "Mathlib.GroupTheory.Submonoid.Basic", "Mathlib.GroupTheory.Submonoid.Operations", "Mathlib.GroupTheory.Submonoid.Center", "Mathlib.GroupTheory.Submonoid.Centralizer", "Mathlib.Order.ModularLattice", "Mathlib.Order.Atoms", "Mathlib.GroupTheory.Subgroup.Basic", "Mathlib.GroupTheory.GroupAction.Basic", "Mathlib.GroupTheory.GroupAction.SubMulAction", "Mathlib.Algebra.FreeMonoid.Basic", "Mathlib.Data.Int.Units", "Mathlib.Algebra.BigOperators.List.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Lemmas", "Mathlib.Algebra.BigOperators.Multiset.Order", "Mathlib.Data.List.MinMax", "Mathlib.Data.Multiset.Fold", "Mathlib.Data.Finset.Fold", "Mathlib.Data.Finset.Option", "Mathlib.Data.Multiset.Pi", "Mathlib.Data.Finset.Pi", "Mathlib.Data.Finset.Prod", "Mathlib.Data.Multiset.Lattice", "Mathlib.Order.Hom.Bounded", "Mathlib.Order.Hom.Lattice", "Mathlib.Data.Finset.Lattice", "Mathlib.Data.Nat.Choose.Basic", "Mathlib.Data.List.Sublists", "Mathlib.Data.Multiset.Powerset", "Mathlib.Data.Finset.Powerset", "Mathlib.Data.Finset.Piecewise", "Mathlib.Data.Fintype.Powerset", "Mathlib.Data.Fintype.Prod", "Mathlib.Data.Set.Sigma", "Mathlib.Data.Finset.Sigma", "Mathlib.Data.Fintype.Sigma", "Mathlib.Data.Multiset.Sum", "Mathlib.Data.Finset.Sum", "Mathlib.Logic.Embedding.Set", "Mathlib.Data.Fintype.Sum", "Mathlib.Data.Fintype.Pi", "Mathlib.Data.Vector", "Mathlib.Control.Applicative", "Mathlib.Control.Traversable.Basic", "Mathlib.Data.Vector.Basic", "Mathlib.Data.Sym.Basic", "Mathlib.Data.Fintype.Vector", "Mathlib.Data.Finite.Basic", "Mathlib.Lean.Expr.ExtraRecognizers", "Mathlib.Data.Set.Functor", "Mathlib.Data.Set.Finite", "Mathlib.Data.Finset.Preimage", "Mathlib.Algebra.BigOperators.Basic", "Mathlib.Algebra.Group.Commute.Hom", "Mathlib.Data.Finset.NoncommProd", "Mathlib.GroupTheory.Submonoid.MulOpposite", "Mathlib.GroupTheory.Submonoid.Membership", "Mathlib.Algebra.Module.Submodule.Basic", "Mathlib.Algebra.Parity", "Mathlib.Algebra.Associated", "Mathlib.Algebra.GCDMonoid.Basic", "Mathlib.Algebra.PUnitInstances", "Mathlib.Algebra.Module.Submodule.Lattice", "Mathlib.Algebra.Module.Submodule.LinearMap", "Mathlib.Algebra.Module.Submodule.Map", "Mathlib.Algebra.Module.Submodule.Ker", "Mathlib.Order.Hom.CompleteLattice", "Mathlib.Algebra.Module.Submodule.RestrictScalars", "Mathlib.Algebra.Group.ULift", "Mathlib.Algebra.Ring.ULift", "Mathlib.Algebra.Module.ULift", "Mathlib.Data.Nat.Cast.Prod", "Mathlib.Data.Int.Cast.Prod", "Mathlib.Data.Prod.Lex", "Mathlib.Algebra.Order.Monoid.Prod", "Mathlib.Algebra.Order.Group.Prod", "Mathlib.Algebra.Ring.Prod", "Mathlib.Algebra.GroupRingAction.Subobjects", "Mathlib.GroupTheory.Subsemigroup.Membership", "Mathlib.RingTheory.NonUnitalSubsemiring.Basic", "Mathlib.RingTheory.Subsemiring.Basic", "Mathlib.RingTheory.Subring.Basic", "Mathlib.Algebra.Algebra.Basic", "Mathlib.Data.Finsupp.Defs", "Mathlib.Data.Finsupp.Indicator", "Mathlib.Algebra.BigOperators.Pi", "Mathlib.Algebra.BigOperators.Ring", "Mathlib.Tactic.Positivity.Basic", "Mathlib.Algebra.Order.Hom.Basic", "Mathlib.Algebra.Order.AbsoluteValue", "Mathlib.Tactic.Ring.Basic", "Mathlib.Tactic.Ring.RingNF", "Mathlib.Algebra.Order.Positive.Ring", "Mathlib.Data.PNat.Basic", "Mathlib.Tactic.Ring.PNat", "Mathlib.Tactic.Ring", "Mathlib.Algebra.BigOperators.Order", "Mathlib.Data.Fintype.Option", "Mathlib.Algebra.BigOperators.Option", "Mathlib.Data.Fintype.BigOperators", "Mathlib.Order.LocallyFinite", "Mathlib.Data.Set.Intervals.Monoid", "Mathlib.Data.Finset.LocallyFinite.Basic", "Mathlib.Data.Nat.Interval", "Mathlib.Data.Fin.Interval", "Mathlib.Data.Fintype.Fin", "Mathlib.Data.List.FinRange", "Mathlib.Data.Fin.VecNotation", "Mathlib.Logic.Equiv.Fin", "Mathlib.Algebra.BigOperators.Fin", "Mathlib.Data.Finsupp.Fin", "Mathlib.Algebra.BigOperators.Finsupp", "Mathlib.Algebra.Algebra.Hom", "Mathlib.Algebra.Algebra.Equiv", "Mathlib.Algebra.Algebra.NonUnitalHom", "Mathlib.GroupTheory.GroupAction.BigOperators", "Mathlib.Algebra.Module.BigOperators", "Mathlib.Data.DFinsupp.Basic", "Mathlib.Data.Rat.BigOperators", "Mathlib.Data.Finsupp.Basic", "Mathlib.Data.Finsupp.ToDFinsupp", "Mathlib.Order.RelIso.Set", "Mathlib.Data.Multiset.Sort", "Mathlib.Data.Finset.Sort", "Mathlib.Data.Nat.ForSqrt", "Mathlib.Data.Nat.Sqrt", "Mathlib.Data.Nat.Pairing", "Mathlib.Logic.Equiv.Nat", "Mathlib.Data.Countable.Defs", "Mathlib.Logic.Encodable.Basic", "Mathlib.Logic.Denumerable", "Mathlib.Logic.Equiv.List", "Mathlib.Data.DFinsupp.Encodable", "Mathlib.Data.Finsupp.Encodable", "Mathlib.Algebra.Module.Hom", "Mathlib.Algebra.Module.Prod", "Mathlib.LinearAlgebra.Basic", "Mathlib.LinearAlgebra.Pi", "Mathlib.Algebra.Ring.Idempotents", "Mathlib.Order.ConditionallyCompleteLattice.Finset", "Mathlib.Data.Nat.Lattice", "Mathlib.Order.OrderIsoNat", "Mathlib.Order.Closure", "Mathlib.Data.Set.Intervals.OrderIso", "Mathlib.Order.UpperLower.Basic", "Mathlib.Order.SupClosed", "Mathlib.Data.Finset.Pairwise", "Mathlib.Order.SupIndep", "Mathlib.Order.Chain", "Mathlib.Order.Zorn", "Mathlib.Data.Finset.Order", "Mathlib.Data.Finite.Set", "Mathlib.Data.List.TFAE", "Mathlib.Tactic.TFAE", "Mathlib.Order.CompactlyGenerated.Basic", "Mathlib.Control.Monad.Basic", "Mathlib.Data.Part", "Mathlib.Order.Hom.Order", "Mathlib.Order.OmegaCompletePartialOrder", "Mathlib.LinearAlgebra.Span", "Mathlib.Data.Countable.Basic", "Mathlib.Data.Set.Countable", "Mathlib.LinearAlgebra.Finsupp", "Mathlib.Algebra.MonoidAlgebra.Basic", "Mathlib.Data.Finset.NAry", "Mathlib.Data.Set.Pointwise.Finite", "Mathlib.Data.Set.Pointwise.ListOfFn", "Mathlib.Algebra.GroupWithZero.Power", "Mathlib.Data.Nat.GCD.Basic", "Mathlib.Data.Int.GCD", "Mathlib.Data.Nat.ModEq", "Mathlib.Data.ZMod.Defs", "Mathlib.Algebra.Order.Ring.Pow", "Mathlib.Algebra.Order.Field.Power", "Mathlib.Data.Int.LeastGreatest", "Mathlib.Data.Set.Intervals.Group", "Mathlib.Data.HashMap", "Mathlib.Tactic.Linarith.Lemmas", "Mathlib.Tactic.Linarith.Datatypes", "Mathlib.Tactic.Linarith.Elimination", "Mathlib.Tactic.Linarith.Parsing", "Mathlib.Tactic.Linarith.Verification", "Mathlib.Tactic.Zify", "Mathlib.Tactic.Linarith.Preprocessing", "Mathlib.Tactic.Linarith.Frontend", "Mathlib.Tactic.Linarith", "Mathlib.Tactic.Positivity", "Mathlib.Algebra.Order.Floor", "Mathlib.Algebra.EuclideanDomain.Defs", "Mathlib.Algebra.EuclideanDomain.Instances", "Mathlib.Util.DischargerAsTactic", "Mathlib.Tactic.FieldSimp", "Mathlib.Data.Rat.Floor", "Mathlib.Algebra.Order.Archimedean", "Mathlib.Algebra.Order.Group.Instances", "Mathlib.Algebra.Order.Hom.Monoid", "Mathlib.Algebra.Order.Hom.Ring", "Mathlib.Order.Iterate", "Mathlib.Order.SuccPred.Basic", "Mathlib.Data.Nat.SuccPred", "Mathlib.Algebra.Order.Sub.WithTop", "Mathlib.Algebra.Order.Ring.WithTop", "Mathlib.Data.ENat.Basic", "Mathlib.Order.SuccPred.Limit", "Mathlib.Order.SuccPred.CompleteLinearOrder", "Mathlib.Dynamics.FixedPoints.Basic", "Mathlib.Order.FixedPoints", "Mathlib.SetTheory.Cardinal.SchroederBernstein", "Mathlib.SetTheory.Cardinal.Basic", "Mathlib.SetTheory.Cardinal.ENat", "Mathlib.SetTheory.Cardinal.ToNat", "Mathlib.Data.ENat.Lattice", "Mathlib.Data.Nat.PartENat", "Mathlib.SetTheory.Cardinal.PartENat", "Mathlib.SetTheory.Cardinal.Finite", "Mathlib.Data.Finset.Pointwise", "Mathlib.Algebra.MonoidAlgebra.Support", "Mathlib.Algebra.MonoidAlgebra.Degree", "Mathlib.Data.Nat.WithBot", "Mathlib.Data.Polynomial.Basic", "Mathlib.Data.Polynomial.Monomial", "Mathlib.Algebra.BigOperators.Intervals", "Mathlib.Data.List.NatAntidiagonal", "Mathlib.Data.Multiset.NatAntidiagonal", "Mathlib.Data.Finset.Antidiagonal", "Mathlib.Data.Finset.NatAntidiagonal", "Mathlib.Algebra.BigOperators.NatAntidiagonal", "Mathlib.Data.Nat.Choose.Sum", "Mathlib.Data.Polynomial.Coeff", "Mathlib.Data.Nat.Cast.WithTop", "Mathlib.Data.Polynomial.Degree.Definitions", "Mathlib.Tactic.FinCases", "Mathlib.RingTheory.Ideal.Basic", "Mathlib.Data.Polynomial.Induction", "Mathlib.Data.Polynomial.Eval", "Mathlib.Data.Polynomial.Degree.Lemmas", "Mathlib.Tactic.ComputeDegree", "Mathlib.Tactic.Continuity.Init", "Mathlib.Tactic.Continuity", "Mathlib.Tactic.ProxyType", "Mathlib.Tactic.DeriveFintype", "Mathlib.Control.Traversable.Lemmas", "Mathlib.Tactic.DeriveTraversable", "Mathlib.Tactic.Eval", "Mathlib.Tactic.Explode.Datatypes", "Mathlib.Tactic.Explode.Pretty", "Mathlib.Tactic.Explode", "Mathlib.Tactic.FunProp.Decl", "Mathlib.Tactic.FunProp.ToStd", "Mathlib.Tactic.FunProp.Mor", "Mathlib.Tactic.FunProp.FunctionData", "Mathlib.Tactic.FunProp.Types", "Mathlib.Tactic.FunProp.StateList", "Mathlib.Tactic.FunProp.RefinedDiscrTree", "Mathlib.Tactic.FunProp.Theorems", "Mathlib.Tactic.FunProp.Attr", "Mathlib.Tactic.FunProp.Core", "Mathlib.Tactic.FunProp.Elab", "Mathlib.Tactic.FunProp", "Mathlib.Data.Nat.Parity", "Mathlib.Algebra.GeomSum", "Mathlib.Algebra.Order.Group.MinMax", "Mathlib.Data.Set.Intervals.Disjoint", "Mathlib.Order.Filter.Basic", "Mathlib.Order.Filter.Prod", "Mathlib.Order.Filter.Ker", "Mathlib.Order.Filter.Bases", "Mathlib.Order.Filter.AtTopBot", "Mathlib.Tactic.GCongr", "Mathlib.Order.Filter.Archimedean", "Mathlib.Order.Filter.Lift", "Mathlib.Topology.Defs.Basic", "Mathlib.Order.Filter.Pi", "Mathlib.Order.Filter.Cofinite", "Mathlib.Order.ZornAtoms", "Mathlib.Order.Filter.Ultrafilter", "Mathlib.Topology.Defs.Filter", "Mathlib.Topology.Basic", "Mathlib.Topology.Defs.Induced", "Mathlib.Topology.Order", "Mathlib.Topology.Maps", "Mathlib.Topology.NhdsSet", "Mathlib.Topology.Constructions", "Mathlib.Topology.ContinuousOn", "Mathlib.Topology.Bases", "Mathlib.Data.Set.Accumulate", "Mathlib.Topology.Bornology.Basic", "Mathlib.Order.Filter.SmallSets", "Mathlib.Topology.LocallyFinite", "Mathlib.Topology.Compactness.Compact", "Mathlib.Topology.Compactness.LocallyCompact", "Mathlib.Topology.Compactness.SigmaCompact", "Mathlib.Order.SuccPred.Relation", "Mathlib.Data.Set.BoolIndicator", "Mathlib.Topology.Clopen", "Mathlib.Order.Minimal", "Mathlib.Topology.Irreducible", "Mathlib.Topology.Connected.Basic", "Mathlib.Topology.Connected.TotallyDisconnected", "Mathlib.Topology.Inseparable", "Mathlib.Topology.Separation", "Mathlib.Topology.DenseEmbedding", "Mathlib.Topology.Support", "Mathlib.Topology.Connected.LocallyConnected", "Mathlib.Topology.Homeomorph", "Mathlib.Data.Set.Intervals.Pi", "Mathlib.Order.Filter.Interval", "Mathlib.Topology.Order.LeftRight", "Mathlib.Topology.Order.OrderClosed", "Mathlib.Topology.Order.Basic", "Mathlib.Topology.Order.MonotoneContinuity", "Mathlib.Algebra.Function.Finite", "Mathlib.Algebra.BigOperators.Finprod", "Mathlib.Topology.Algebra.InfiniteSum.Defs", "Mathlib.Order.Filter.NAry", "Mathlib.Order.Filter.Pointwise", "Mathlib.Algebra.AddTorsor", "Mathlib.Topology.Algebra.Constructions", "Mathlib.Topology.Algebra.ConstMulAction", "Mathlib.Topology.Algebra.MulAction", "Mathlib.Data.Set.UnionLift", "Mathlib.Topology.ContinuousFunction.Basic", "Mathlib.Topology.Algebra.Monoid", "Mathlib.Topology.Algebra.InfiniteSum.Basic", "Mathlib.Tactic.Monotonicity.Basic", "Mathlib.Tactic.Monotonicity.Lemmas", "Mathlib.Tactic.Monotonicity", "Mathlib.Topology.UniformSpace.Basic", "Mathlib.Topology.UniformSpace.Cauchy", "Mathlib.Topology.UniformSpace.UniformConvergence", "Mathlib.Topology.UniformSpace.Separation", "Mathlib.Topology.UniformSpace.UniformEmbedding", "Mathlib.Topology.UniformSpace.CompleteSeparated", "Mathlib.Topology.UniformSpace.Pi", "Mathlib.Topology.UniformSpace.Equiv", "Mathlib.Topology.UniformSpace.UniformConvergenceTopology", "Mathlib.Topology.UniformSpace.Equicontinuity", "Mathlib.Topology.UniformSpace.Compact", "Mathlib.GroupTheory.Subgroup.ZPowers", "Mathlib.GroupTheory.GroupAction.ConjAct", "Mathlib.Data.Fintype.Units", "Mathlib.Algebra.Group.ConjFinite", "Mathlib.Data.Fintype.List", "Mathlib.Data.List.Cycle", "Mathlib.Data.Nat.Prime", "Mathlib.Dynamics.PeriodicPts", "Mathlib.Algebra.Group.Commutator", "Mathlib.GroupTheory.Subgroup.Finite", "Mathlib.Tactic.Group", "Mathlib.GroupTheory.Commutator", "Mathlib.Algebra.Quotient", "Mathlib.GroupTheory.Subgroup.MulOpposite", "Mathlib.GroupTheory.Subgroup.Actions", "Mathlib.GroupTheory.Coset", "Mathlib.GroupTheory.GroupAction.Quotient", "Mathlib.GroupTheory.Congruence", "Mathlib.Init.Data.Sigma.Lex", "Mathlib.Data.Sigma.Lex", "Mathlib.Order.WellFoundedSet", "Mathlib.GroupTheory.Submonoid.Pointwise", "Mathlib.GroupTheory.Subgroup.Pointwise", "Mathlib.GroupTheory.QuotientGroup", "Mathlib.Topology.Algebra.Group.Basic", "Mathlib.Topology.DiscreteSubset", "Mathlib.Topology.Algebra.UniformGroup", "Mathlib.Topology.Algebra.InfiniteSum.Group", "Mathlib.Logic.Encodable.Lattice", "Mathlib.Topology.Algebra.InfiniteSum.NatInt", "Mathlib.Topology.Algebra.Order.Group", "Mathlib.Topology.Algebra.Ring.Basic", "Mathlib.Topology.Algebra.GroupWithZero", "Mathlib.Order.Filter.Extr", "Mathlib.Topology.Order.LocalExtr", "Mathlib.FieldTheory.Subfield", "Mathlib.Topology.Algebra.Field", "Mathlib.Data.Set.Pointwise.Interval", "Mathlib.Topology.Algebra.Order.Field", "Mathlib.Topology.Order.MonotoneConvergence", "Mathlib.Topology.Algebra.InfiniteSum.Order", "Mathlib.Data.Int.Parity", "Mathlib.Data.Int.Order.Units", "Mathlib.Data.Int.ModEq", "Mathlib.Data.Nat.Log", "Mathlib.Data.List.Indexes", "Mathlib.Data.List.Palindrome", "Mathlib.Tactic.IntervalCases", "Mathlib.Data.Nat.Digits", "Mathlib.RingTheory.Multiplicity", "Mathlib.Data.Nat.Multiplicity", "Mathlib.Data.Set.Intervals.Infinite", "Mathlib.Data.Finite.Card", "Mathlib.GroupTheory.Finiteness", "Mathlib.GroupTheory.Index", "Mathlib.GroupTheory.OrderOfElement", "Mathlib.Algebra.CharP.Basic", "Mathlib.LinearAlgebra.BilinearMap", "Mathlib.Algebra.Module.Submodule.Bilinear", "Mathlib.Tactic.SuppressCompilation", "Mathlib.LinearAlgebra.TensorProduct.Basic", "Mathlib.Algebra.Algebra.Bilinear", "Mathlib.Algebra.Module.Opposites", "Mathlib.Algebra.Algebra.Opposite", "Mathlib.Algebra.GroupWithZero.NonZeroDivisors", "Mathlib.Algebra.Order.Group.Action", "Mathlib.Algebra.Module.Submodule.Pointwise", "Mathlib.Algebra.Order.Kleene", "Mathlib.Data.Set.Pointwise.BigOperators", "Mathlib.Data.Set.Semiring", "Mathlib.GroupTheory.GroupAction.SubMulAction.Pointwise", "Mathlib.Algebra.Algebra.Operations", "Mathlib.Data.Fintype.Lattice", "Mathlib.RingTheory.Coprime.Basic", "Mathlib.RingTheory.Coprime.Lemmas", "Mathlib.Algebra.Algebra.Prod", "Mathlib.Order.PartialSups", "Mathlib.LinearAlgebra.Prod", "Mathlib.Tactic.LinearCombination", "Mathlib.LinearAlgebra.LinearIndependent", "Mathlib.Algebra.Ring.OrderSynonym", "Mathlib.Algebra.Order.Module.Synonym", "Mathlib.Algebra.Order.Module.Defs", "Mathlib.Data.Finsupp.Order", "Mathlib.Data.Finsupp.Multiset", "Mathlib.Order.Bounded", "Mathlib.Data.Sum.Order", "Mathlib.Order.InitialSeg", "Mathlib.SetTheory.Ordinal.Basic", "Mathlib.SetTheory.Ordinal.Arithmetic", "Mathlib.SetTheory.Ordinal.Exponential", "Mathlib.SetTheory.Ordinal.FixedPoint", "Mathlib.SetTheory.Ordinal.Principal", "Mathlib.SetTheory.Cardinal.Ordinal", "Mathlib.SetTheory.Cardinal.Cofinality", "Mathlib.LinearAlgebra.Basis", "Mathlib.LinearAlgebra.Quotient", "Mathlib.RingTheory.Ideal.Operations", "Mathlib.Data.ZMod.Basic", "Mathlib.Data.ZMod.IntUnitsPower", "Mathlib.Algebra.GroupPower.NegOnePow", "Mathlib.Algebra.Periodic", "Mathlib.Topology.UniformSpace.AbstractCompletion", "Mathlib.Topology.UniformSpace.Completion", "Mathlib.Topology.Algebra.UniformMulAction", "Mathlib.Algebra.Star.Pi", "Mathlib.Algebra.Star.Prod", "Mathlib.Topology.Algebra.Star", "Mathlib.Data.Int.Interval", "Mathlib.Data.Int.SuccPred", "Mathlib.Data.Int.ConditionallyCompleteOrder", "Mathlib.Topology.Order.IntermediateValue", "Mathlib.Topology.Algebra.Order.Compact", "Mathlib.Algebra.BigOperators.WithTop", "Mathlib.Algebra.Order.Field.Canonical.Defs", "Mathlib.Algebra.Order.Field.Canonical.Basic", "Mathlib.Algebra.Order.Field.InjSurj", "Mathlib.Algebra.Order.Nonneg.Field", "Mathlib.Algebra.Order.Nonneg.Floor", "Mathlib.Algebra.Order.Pi", "Mathlib.Algebra.Order.Module.OrderedSMul", "Mathlib.Algebra.Order.Module.Pointwise", "Mathlib.Algebra.Bounds", "Mathlib.GroupTheory.GroupAction.Ring", "Mathlib.Init.Align", "Mathlib.Algebra.Order.CauSeq.Basic", "Mathlib.Algebra.Order.CauSeq.Completion", "Mathlib.Data.Real.Basic", "Mathlib.Data.Real.Archimedean", "Mathlib.Data.Real.Pointwise", "Mathlib.Order.ConditionallyCompleteLattice.Group", "Mathlib.Data.Real.NNReal", "Mathlib.Data.Set.Intervals.WithBotTop", "Mathlib.Data.ENNReal.Basic", "Mathlib.Data.ENNReal.Operations", "Mathlib.Data.ENNReal.Inv", "Mathlib.Data.ENNReal.Real", "Mathlib.Topology.EMetricSpace.Basic", "Mathlib.Topology.Bornology.Constructions", "Mathlib.Topology.MetricSpace.PseudoMetric", "Mathlib.Topology.MetricSpace.ProperSpace", "Mathlib.Topology.MetricSpace.Basic", "Mathlib.Topology.Metrizable.Basic", "Mathlib.Topology.Metrizable.Uniformity", "Mathlib.Topology.Instances.Discrete", "Mathlib.Topology.MetricSpace.Cauchy", "Mathlib.Topology.MetricSpace.Bounded", "Mathlib.Topology.Instances.Int", "Mathlib.Topology.Instances.Real", "Mathlib.Topology.Algebra.InfiniteSum.Real", "Mathlib.Algebra.Order.Support", "Mathlib.Order.LiminfLimsup", "Mathlib.Order.Filter.CountableInter", "Mathlib.Topology.Algebra.Order.LiminfLimsup", "Mathlib.Topology.Algebra.InfiniteSum.Constructions", "Mathlib.Topology.Algebra.InfiniteSum.Ring", "Mathlib.Topology.Instances.NNReal", "Mathlib.Topology.EMetricSpace.Lipschitz", "Mathlib.Data.Set.Intervals.OrdConnectedComponent", "Mathlib.Topology.Order.T5", "Mathlib.Topology.Instances.ENNReal", "Mathlib.Algebra.Algebra.Subalgebra.Basic", "Mathlib.LinearAlgebra.Projection", "Mathlib.Topology.Algebra.Module.Basic", "Mathlib.Algebra.Algebra.Tower", "Mathlib.Algebra.Algebra.Subalgebra.Tower", "Mathlib.RingTheory.Adjoin.Basic", "Mathlib.Topology.Algebra.Algebra", "Mathlib.Analysis.SpecificLimits.Basic", "Mathlib.Order.Disjointed", "Mathlib.Tactic.Measurability.Init", "Mathlib.Tactic.Measurability", "Mathlib.MeasureTheory.MeasurableSpace.Defs", "Mathlib.MeasureTheory.PiSystem", "Mathlib.MeasureTheory.OuterMeasure.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpaceDef", "Mathlib.MeasureTheory.Measure.AEDisjoint", "Mathlib.MeasureTheory.Measure.NullMeasurable", "Mathlib.Data.Finset.Update", "Mathlib.Data.Prod.TProd", "Mathlib.MeasureTheory.MeasurableSpace.Basic", "Mathlib.MeasureTheory.Measure.MeasureSpace", "Mathlib.MeasureTheory.Measure.Restrict", "Mathlib.MeasureTheory.Measure.Typeclasses", "Mathlib.MeasureTheory.Measure.Trim", "Mathlib.Data.Set.MemPartition", "Mathlib.Order.Filter.CountableSeparatingOn", "Mathlib.MeasureTheory.MeasurableSpace.CountablyGenerated", "Mathlib.MeasureTheory.Measure.AEMeasurable", "Mathlib.Dynamics.Ergodic.MeasurePreserving", "Mathlib.Analysis.Normed.Group.Seminorm", "Mathlib.GroupTheory.Archimedean", "Mathlib.Topology.Algebra.Order.Archimedean", "Mathlib.Topology.Instances.Nat", "Mathlib.Topology.Instances.Rat", "Mathlib.Data.Set.Intervals.ProjIcc", "Mathlib.Topology.Bornology.Hom", "Mathlib.Topology.MetricSpace.Lipschitz", "Mathlib.Topology.MetricSpace.Algebra", "Mathlib.Topology.MetricSpace.Antilipschitz", "Mathlib.Topology.MetricSpace.Isometry", "Mathlib.Topology.MetricSpace.IsometricSMul", "Mathlib.Topology.Defs.Sequences", "Mathlib.Topology.Sequences", "Mathlib.Analysis.Normed.Group.Basic", "Mathlib.MeasureTheory.Function.AEMeasurableSequence", "Mathlib.MeasureTheory.Group.Arithmetic", "Mathlib.MeasureTheory.Order.Lattice", "Mathlib.Data.Rat.Encodable", "Mathlib.Data.Sign", "Mathlib.Data.Real.EReal", "Mathlib.Topology.Instances.EReal", "Mathlib.Topology.MetricSpace.HausdorffDistance", "Mathlib.Topology.MetricSpace.Thickening", "Mathlib.Topology.GDelta", "Mathlib.Topology.Order.Lattice", "Mathlib.Topology.Semicontinuous", "Mathlib.MeasureTheory.Constructions.BorelSpace.Basic", "Mathlib.MeasureTheory.Function.SimpleFunc", "Mathlib.MeasureTheory.Measure.MutuallySingular", "Mathlib.MeasureTheory.Measure.Dirac", "Mathlib.MeasureTheory.Measure.Count", "Mathlib.Topology.IndicatorConstPointwise", "Mathlib.MeasureTheory.Integral.Lebesgue", "Mathlib.MeasureTheory.Measure.GiryMonad", "Mathlib.MeasureTheory.Measure.OpenPos", "Mathlib.MeasureTheory.Constructions.Prod.Basic", "Mathlib.LinearAlgebra.AffineSpace.Basic", "Mathlib.LinearAlgebra.AffineSpace.AffineMap", "Mathlib.LinearAlgebra.GeneralLinearGroup", "Mathlib.LinearAlgebra.AffineSpace.AffineEquiv", "Mathlib.LinearAlgebra.AffineSpace.Midpoint", "Mathlib.Algebra.Order.Module.Algebra", "Mathlib.GroupTheory.Submonoid.Order", "Mathlib.RingTheory.Subring.Units", "Mathlib.LinearAlgebra.Ray", "Mathlib.Analysis.Convex.Segment", "Mathlib.Analysis.Convex.Star", "Mathlib.LinearAlgebra.AffineSpace.AffineSubspace", "Mathlib.Analysis.Convex.Basic", "Mathlib.Analysis.Convex.Function", "Mathlib.Analysis.Convex.Hull", "Mathlib.Algebra.Algebra.Pi", "Mathlib.Algebra.Algebra.RestrictScalars", "Mathlib.RingTheory.NonUnitalSubring.Basic", "Mathlib.Algebra.Algebra.NonUnitalSubalgebra", "Mathlib.Topology.MetricSpace.Dilation", "Mathlib.Topology.MetricSpace.DilationEquiv", "Mathlib.Analysis.Normed.Field.Basic", "Mathlib.Analysis.Normed.MulAction", "Mathlib.Analysis.NormedSpace.Basic", "Mathlib.Topology.Bornology.Absorbs", "Mathlib.Analysis.LocallyConvex.Basic", "Mathlib.Init.Data.Subtype.Basic", "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.Algebra.Star.Order", "Mathlib.Data.Real.Sqrt", "Mathlib.Analysis.Seminorm", "Mathlib.Algebra.Module.LinearMap.Pointwise", "Mathlib.Analysis.LocallyConvex.BalancedCoreHull", "Mathlib.Analysis.LocallyConvex.Bounded", "Mathlib.Topology.Algebra.FilterBasis", "Mathlib.Topology.Algebra.UniformConvergence", "Mathlib.Topology.Algebra.Equicontinuity", "Mathlib.Topology.MetricSpace.Equicontinuity", "Mathlib.LinearAlgebra.AffineSpace.Combination", "Mathlib.Data.Finsupp.Fintype", "Mathlib.Algebra.DirectSum.Basic", "Mathlib.LinearAlgebra.DFinsupp", "Mathlib.Algebra.DirectSum.Module", "Mathlib.Algebra.DirectSum.Finsupp", "Mathlib.LinearAlgebra.DirectSum.TensorProduct", "Mathlib.LinearAlgebra.DirectSum.Finsupp", "Mathlib.Algebra.BigOperators.RingEquiv", "Mathlib.Algebra.Star.BigOperators", "Mathlib.Algebra.Star.Module", "Mathlib.Data.Matrix.Basic", "Mathlib.Data.Matrix.Block", "Mathlib.Data.Matrix.RowCol", "Mathlib.LinearAlgebra.Matrix.Trace", "Mathlib.Data.Matrix.Basis", "Mathlib.LinearAlgebra.StdBasis", "Mathlib.LinearAlgebra.FinsuppVectorSpace", "Mathlib.LinearAlgebra.TensorProduct.Basis", "Mathlib.LinearAlgebra.FreeModule.Basic", "Mathlib.LinearAlgebra.LinearPMap", "Mathlib.LinearAlgebra.Basis.VectorSpace", "Mathlib.LinearAlgebra.AffineSpace.Independent", "Mathlib.LinearAlgebra.AffineSpace.Basis", "Mathlib.Analysis.Convex.Combination", "Mathlib.Analysis.Convex.Strict", "Mathlib.Topology.Order.ProjIcc", "Mathlib.Topology.CompactOpen", "Mathlib.Data.Set.Intervals.Instances", "Mathlib.Topology.UnitInterval", "Mathlib.Topology.Connected.PathConnected", "Mathlib.Topology.Algebra.Affine", "Mathlib.Analysis.Convex.Topology", "Mathlib.Topology.Algebra.Module.LocallyConvex", "Mathlib.Analysis.LocallyConvex.WithSeminorms", "Mathlib.Topology.Algebra.Module.StrongTopology", "Mathlib.Analysis.NormedSpace.LinearIsometry", "Mathlib.Analysis.NormedSpace.ContinuousLinearMap", "Mathlib.Analysis.NormedSpace.OperatorNorm.Basic", "Mathlib.Analysis.NormedSpace.OperatorNorm.Bilinear", "Mathlib.Analysis.NormedSpace.OperatorNorm.NNNorm", "Mathlib.Analysis.NormedSpace.Span", "Mathlib.Analysis.NormedSpace.OperatorNorm.NormedSpace", "Mathlib.LinearAlgebra.Isomorphisms", "Mathlib.Algebra.Group.Equiv.TypeTags", "Mathlib.RingTheory.Congruence", "Mathlib.RingTheory.Ideal.Quotient", "Mathlib.Algebra.Ring.Fin", "Mathlib.RingTheory.Ideal.QuotientOperations", "Mathlib.Algebra.EuclideanDomain.Basic", "Mathlib.Data.List.Prime", "Mathlib.Data.Nat.Factors", "Mathlib.Algebra.BigOperators.Associated", "Mathlib.Order.Filter.Subsingleton", "Mathlib.Order.Filter.EventuallyConst", "Mathlib.RingTheory.Finiteness", "Mathlib.Data.Matrix.Notation", "Mathlib.RingTheory.AlgebraTower", "Mathlib.LinearAlgebra.Matrix.ToLin", "Mathlib.RingTheory.Nilpotent", "Mathlib.RingTheory.Noetherian", "Mathlib.RingTheory.UniqueFactorizationDomain", "Mathlib.RingTheory.PrincipalIdealDomain", "Mathlib.RingTheory.Int.Basic", "Mathlib.Data.ZMod.Quotient", "Mathlib.Data.Nat.GCD.BigOperators", "Mathlib.GroupTheory.NoncommPiCoprod", "Mathlib.Algebra.GCDMonoid.Multiset", "Mathlib.Algebra.GCDMonoid.Finset", "Mathlib.Data.Nat.PrimeFin", "Mathlib.NumberTheory.Divisors", "Mathlib.Data.Nat.MaxPowDiv", "Mathlib.NumberTheory.Padics.PadicVal", "Mathlib.Data.Nat.Factorization.Basic", "Mathlib.Tactic.Peel", "Mathlib.GroupTheory.Exponent", "Mathlib.Combinatorics.Enumerative.Composition", "Mathlib.Combinatorics.Enumerative.Partition", "Mathlib.Data.Fintype.Perm", "Mathlib.GroupTheory.Perm.Support", "Mathlib.GroupTheory.Perm.List", "Mathlib.Data.Finset.Fin", "Mathlib.GroupTheory.Perm.Sign", "Mathlib.Logic.Equiv.Fintype", "Mathlib.GroupTheory.Perm.Finite", "Mathlib.GroupTheory.Perm.Cycle.Basic", "Mathlib.GroupTheory.Perm.Cycle.Factors", "Mathlib.GroupTheory.Perm.Closure", "Mathlib.Tactic.NormNum.GCD", "Mathlib.GroupTheory.Perm.Cycle.Type", "Mathlib.Init.Data.Prod", "Mathlib.GroupTheory.MonoidLocalization", "Mathlib.RingTheory.Localization.Basic", "Mathlib.RingTheory.Localization.FractionRing", "Mathlib.Algebra.Group.UniqueProds", "Mathlib.Algebra.MonoidAlgebra.NoZeroDivisors", "Mathlib.Algebra.FreeAlgebra", "Mathlib.Algebra.CharP.Algebra", "Mathlib.Algebra.CharP.ExpChar", "Mathlib.Algebra.CharP.Two", "Mathlib.Data.Nat.Count", "Mathlib.Data.Nat.Periodic", "Mathlib.Data.Nat.Totient", "Mathlib.GroupTheory.Subgroup.Simple", "Mathlib.GroupTheory.SpecificGroups.Cyclic", "Mathlib.GroupTheory.PGroup", "Mathlib.GroupTheory.Torsion", "Mathlib.RingTheory.Coprime.Ideal", "Mathlib.Algebra.Module.Torsion", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic", "Mathlib.LinearAlgebra.Dimension.Basic", "Mathlib.LinearAlgebra.Dimension.Finrank", "Mathlib.LinearAlgebra.InvariantBasisNumber", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.Dimension.Finite", "Mathlib.Data.W.Basic", "Mathlib.Data.W.Cardinal", "Mathlib.SetTheory.Cardinal.Subfield", "Mathlib.LinearAlgebra.Dimension.Free", "Mathlib.LinearAlgebra.Dimension.Constructions", "Mathlib.LinearAlgebra.Dimension.DivisionRing", "Mathlib.LinearAlgebra.Dimension.LinearMap", "Mathlib.Algebra.Regular.Pow", "Mathlib.Data.Multiset.Antidiagonal", "Mathlib.Data.Finsupp.Antidiagonal", "Mathlib.Data.MvPolynomial.Basic", "Mathlib.Data.MvPolynomial.Rename", "Mathlib.Data.MvPolynomial.Degrees", "Mathlib.Data.MvPolynomial.Variables", "Mathlib.Data.MvPolynomial.CommRing", "Mathlib.Data.Polynomial.AlgebraMap", "Mathlib.Data.MvPolynomial.Equiv", "Mathlib.Data.Polynomial.Derivative", "Mathlib.Algebra.MonoidAlgebra.Division", "Mathlib.Data.Polynomial.EraseLead", "Mathlib.Data.Polynomial.Inductions", "Mathlib.Data.Polynomial.Degree.TrailingDegree", "Mathlib.Data.Polynomial.Reverse", "Mathlib.Data.Polynomial.Monic", "Mathlib.Data.Polynomial.Div", "Mathlib.Algebra.Polynomial.BigOperators", "Mathlib.Data.Polynomial.RingDivision", "Mathlib.RingTheory.EuclideanDomain", "Mathlib.Data.Polynomial.FieldDivision", "Mathlib.Data.Polynomial.CancelLeads", "Mathlib.RingTheory.Polynomial.Content", "Mathlib.RingTheory.Polynomial.Basic", "Mathlib.RingTheory.Polynomial.Quotient", "Mathlib.RingTheory.JacobsonIdeal", "Mathlib.Logic.Equiv.TransferInstance", "Mathlib.RingTheory.Ideal.LocalRing", "Mathlib.Data.Polynomial.Expand", "Mathlib.Data.Polynomial.Laurent", "Mathlib.Data.PEquiv", "Mathlib.Data.Matrix.PEquiv", "Mathlib.GroupTheory.Perm.Option", "Mathlib.GroupTheory.Perm.Fin", "Mathlib.Data.Fintype.Sort", "Mathlib.LinearAlgebra.Multilinear.Basic", "Mathlib.LinearAlgebra.Multilinear.Basis", "Mathlib.LinearAlgebra.Alternating.Basic", "Mathlib.LinearAlgebra.Matrix.Determinant", "Mathlib.LinearAlgebra.Matrix.MvPolynomial", "Mathlib.LinearAlgebra.Matrix.Polynomial", "Mathlib.LinearAlgebra.Matrix.Adjugate", "Mathlib.FieldTheory.Finiteness", "Mathlib.LinearAlgebra.FiniteDimensional", "Mathlib.LinearAlgebra.TensorProduct.Tower", "Mathlib.RingTheory.TensorProduct.Basic", "Mathlib.RingTheory.MatrixAlgebra", "Mathlib.Data.Matrix.DMatrix", "Mathlib.RingTheory.PolynomialAlgebra", "Mathlib.LinearAlgebra.Matrix.Charpoly.Basic", "Mathlib.LinearAlgebra.Matrix.Reindex", "Mathlib.Data.Polynomial.Identities", "Mathlib.RingTheory.Polynomial.Tower", "Mathlib.RingTheory.Polynomial.Nilpotent", "Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff", "Mathlib.LinearAlgebra.Matrix.Charpoly.LinearMap", "Mathlib.RingTheory.Adjoin.FG", "Mathlib.RingTheory.Adjoin.Tower", "Mathlib.Data.Polynomial.Module.Basic", "Mathlib.RingTheory.FiniteType", "Mathlib.RingTheory.Polynomial.ScaleRoots", "Mathlib.RingTheory.IntegralClosure", "Mathlib.FieldTheory.Minpoly.Basic", "Mathlib.RingTheory.Polynomial.IntegralNormalization", "Mathlib.RingTheory.Algebraic", "Mathlib.FieldTheory.Minpoly.Field", "Mathlib.LinearAlgebra.Charpoly.Basic", "Mathlib.LinearAlgebra.FreeModule.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Matrix", "Mathlib.Control.Bifunctor", "Mathlib.Logic.Equiv.Functor", "Mathlib.Order.JordanHolder", "Mathlib.Order.CompactlyGenerated.Intervals", "Mathlib.RingTheory.SimpleModule", "Mathlib.Topology.Algebra.Module.Simple", "Mathlib.Data.Matrix.Invertible", "Mathlib.LinearAlgebra.Matrix.NonsingularInverse", "Mathlib.LinearAlgebra.Matrix.Basis", "Mathlib.LinearAlgebra.Determinant", "Mathlib.Topology.Algebra.Module.Determinant", "Mathlib.Topology.Algebra.Module.FiniteDimension", "Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap", "Mathlib.Analysis.Normed.Group.InfiniteSum", "Mathlib.Logic.Equiv.PartialEquiv", "Mathlib.Order.Copy", "Mathlib.Topology.Sets.Opens", "Mathlib.Topology.PartialHomeomorph", "Mathlib.Analysis.Asymptotics.Asymptotics", "Mathlib.Analysis.Asymptotics.Theta", "Mathlib.Algebra.Order.Group.TypeTags", "Mathlib.Analysis.Normed.Order.Basic", "Mathlib.Analysis.Asymptotics.AsymptoticEquivalent", "Mathlib.Analysis.Calculus.TangentCone", "Mathlib.Analysis.NormedSpace.OperatorNorm.Asymptotics", "Mathlib.Analysis.Calculus.FDeriv.Basic", "Mathlib.Topology.Algebra.Module.Multilinear.Basic", "Mathlib.Analysis.NormedSpace.Multilinear.Basic", "Mathlib.Topology.Algebra.Ring.Ideal", "Mathlib.Algebra.BigOperators.Module", "Mathlib.Analysis.SpecificLimits.Normed", "Mathlib.Analysis.NormedSpace.Units", "Mathlib.Analysis.NormedSpace.OperatorNorm.Completeness", "Mathlib.Analysis.NormedSpace.OperatorNorm.Mul", "Mathlib.Analysis.NormedSpace.BoundedLinearMaps", "Mathlib.Analysis.Calculus.FDeriv.Linear", "Mathlib.Analysis.Calculus.FDeriv.Comp", "Mathlib.Analysis.Calculus.FDeriv.Equiv", "Mathlib.Analysis.NormedSpace.Multilinear.Curry", "Mathlib.Analysis.Calculus.FormalMultilinearSeries", "Mathlib.Analysis.Calculus.ContDiff.Defs", "Mathlib.Analysis.Calculus.FDeriv.Add", "Mathlib.Analysis.Calculus.FDeriv.Prod", "Mathlib.Analysis.Calculus.FDeriv.Bilinear", "Mathlib.Analysis.Calculus.FDeriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Basic", "Mathlib.Analysis.Calculus.FDeriv.RestrictScalars", "Mathlib.Analysis.Calculus.Deriv.Comp", "Mathlib.Analysis.Calculus.Deriv.Inverse", "Mathlib.Analysis.Calculus.ContDiff.Basic", "Mathlib.Algebra.GroupWithZero.Bitwise", "Mathlib.Data.Complex.Basic", "Mathlib.Data.Rat.Denumerable", "Mathlib.SetTheory.Cardinal.Continuum", "Mathlib.Data.Real.Cardinality", "Mathlib.Data.Complex.Cardinality", "Mathlib.FieldTheory.Tower", "Mathlib.Algebra.CharP.Invertible", "Mathlib.Data.Complex.Module", "Mathlib.Data.Complex.Abs", "Mathlib.Data.Complex.Order", "Mathlib.Algebra.Order.CauSeq.BigOperators", "Mathlib.Data.Complex.BigOperators", "Mathlib.Data.Complex.Exponential", "Mathlib.Analysis.Normed.Group.Hom", "Mathlib.Algebra.Star.Pointwise", "Mathlib.Algebra.Star.Center", "Mathlib.Algebra.Star.StarAlgHom", "Mathlib.Algebra.Star.Subalgebra", "Mathlib.Algebra.Star.Unitary", "Mathlib.Topology.Algebra.Module.Star", "Mathlib.Analysis.NormedSpace.Star.Basic", "Mathlib.Analysis.RCLike.Basic", "Mathlib.Topology.Algebra.InfiniteSum.Module", "Mathlib.Topology.Instances.RealVectorSpace", "Mathlib.Analysis.Complex.Basic", "Mathlib.Analysis.SpecialFunctions.Exp", "Mathlib.Analysis.NormedSpace.Real", "Mathlib.Analysis.SpecialFunctions.Log.Basic", "Mathlib.Tactic.FunProp.Measurable", "Mathlib.Tactic.FunProp.AEMeasurable", "Mathlib.Analysis.Calculus.Deriv.Mul", "Mathlib.Analysis.Calculus.Deriv.Add", "Mathlib.Analysis.Calculus.Deriv.Shift", "Mathlib.Analysis.Calculus.IteratedDeriv.Defs", "Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas", "Mathlib.Analysis.Calculus.Deriv.Linear", "Mathlib.Analysis.Normed.Group.BallSphere", "Mathlib.Analysis.Normed.Field.UnitBall", "Mathlib.Analysis.Complex.Circle", "Mathlib.LinearAlgebra.Matrix.Transvection", "Mathlib.Algebra.CharP.Reduced", "Mathlib.RingTheory.IntegralDomain", "Mathlib.RingTheory.RootsOfUnity.Basic", "Mathlib.LinearAlgebra.Matrix.SpecialLinearGroup", "Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup", "Mathlib.Analysis.Complex.Isometry", "Mathlib.Analysis.NormedSpace.ConformalLinearMap", "Mathlib.Analysis.Normed.Group.Lemmas", "Mathlib.Analysis.Normed.Group.AddTorsor", "Mathlib.Analysis.NormedSpace.AddTorsor", "Mathlib.LinearAlgebra.AffineSpace.Restrict", "Mathlib.Analysis.NormedSpace.AffineIsometry", "Mathlib.Analysis.NormedSpace.RieszLemma", "Mathlib.Analysis.Normed.Group.Pointwise", "Mathlib.Analysis.NormedSpace.Pointwise", "Mathlib.Topology.Instances.Matrix", "Mathlib.Analysis.NormedSpace.FiniteDimension", "Mathlib.Analysis.Complex.Conformal", "Mathlib.Analysis.Calculus.Conformal.NormedSpace", "Mathlib.Analysis.Complex.RealDeriv", "Mathlib.Analysis.Calculus.Deriv.AffineMap", "Mathlib.LinearAlgebra.AffineSpace.Slope", "Mathlib.Analysis.Calculus.Deriv.Slope", "Mathlib.Analysis.Calculus.LocalExtr.Basic", "Mathlib.Topology.ExtendFrom", "Mathlib.Topology.Order.ExtendFrom", "Mathlib.Topology.Algebra.Order.Rolle", "Mathlib.Analysis.Calculus.LocalExtr.Rolle", "Mathlib.LinearAlgebra.AffineSpace.FiniteDimensional", "Mathlib.Analysis.Convex.Between", "Mathlib.Analysis.Convex.Jensen", "Mathlib.Analysis.Convex.Normed", "Mathlib.Analysis.Calculus.MeanValue", "Mathlib.Analysis.Calculus.ContDiff.RCLike", "Mathlib.Analysis.SpecialFunctions.ExpDeriv", "Mathlib.Analysis.Calculus.Deriv.Pow", "Mathlib.Analysis.SpecialFunctions.Log.Deriv", "Mathlib.Analysis.Calculus.FDeriv.Pi", "Mathlib.Analysis.Calculus.Deriv.Inv", "Mathlib.Tactic.FunProp.Differentiable", "Mathlib.Tactic.FunProp.ContDiff", "Mathlib.Tactic.Generalize", "Mathlib.Tactic.Have", "Mathlib.Tactic.LiftLets", "Mathlib.Tactic.ModCases", "Mathlib.Tactic.MoveAdd", "Mathlib.Tactic.NoncommRing", "Mathlib.Tactic.NormNum.BigOperators", "Mathlib.Tactic.NormNum.IsCoprime", "Mathlib.Data.Fintype.Parity", "Mathlib.Data.Int.Range", "Mathlib.NumberTheory.LegendreSymbol.MulCharacter", "Mathlib.NumberTheory.LegendreSymbol.ZModChar", "Mathlib.Algebra.Squarefree.Basic", "Mathlib.Data.Polynomial.Lifts", "Mathlib.Data.Polynomial.Splits", "Mathlib.RingTheory.PowerBasis", "Mathlib.FieldTheory.Separable", "Mathlib.FieldTheory.Finite.Basic", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.Basic", "Mathlib.NumberTheory.LegendreSymbol.Basic", "Mathlib.Data.PNat.Prime", "Mathlib.Algebra.IsPrimePow", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic", "Mathlib.Analysis.Normed.Group.Quotient", "Mathlib.Algebra.Ring.AddAut", "Mathlib.GroupTheory.Divisible", "Mathlib.Algebra.ModEq", "Mathlib.Order.Circular", "Mathlib.Algebra.Order.ToIntervalMod", "Mathlib.Topology.Instances.AddCircle", "Mathlib.Analysis.Normed.Group.AddCircle", "Mathlib.Algebra.CharZero.Quotient", "Mathlib.Topology.Instances.Sign", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Angle", "Mathlib.Analysis.SpecialFunctions.Trigonometric.Inverse", "Mathlib.Analysis.SpecialFunctions.Complex.Arg", "Mathlib.Analysis.SpecialFunctions.Complex.Log", "Mathlib.RingTheory.RootsOfUnity.Complex", "Mathlib.RingTheory.HahnSeries.Basic", "Mathlib.RingTheory.HahnSeries.Addition", "Mathlib.Data.Set.MulAntidiagonal", "Mathlib.Data.Finset.MulAntidiagonal", "Mathlib.RingTheory.HahnSeries.Multiplication", "Mathlib.Data.Finset.PiAntidiagonal", "Mathlib.RingTheory.MvPowerSeries.Basic", "Mathlib.RingTheory.PowerSeries.Basic", "Mathlib.Data.Finsupp.PWO", "Mathlib.RingTheory.HahnSeries.PowerSeries", "Mathlib.Algebra.Order.Group.WithTop", "Mathlib.RingTheory.Valuation.Basic", "Mathlib.RingTheory.HahnSeries.Summable", "Mathlib.RingTheory.LaurentSeries", "Mathlib.FieldTheory.RatFunc", "Mathlib.Data.Nat.Factorization.PrimePow", "Mathlib.Data.Nat.Squarefree", "Mathlib.NumberTheory.ArithmeticFunction", "Mathlib.RingTheory.Polynomial.Cyclotomic.Basic", "Mathlib.RingTheory.MvPolynomial.Tower", "Mathlib.RingTheory.FinitePresentation", "Mathlib.RingTheory.QuotientNoetherian", "Mathlib.RingTheory.AdjoinRoot", "Mathlib.FieldTheory.IntermediateField", "Mathlib.RingTheory.Adjoin.Field", "Mathlib.FieldTheory.SplittingField.IsSplittingField", "Mathlib.FieldTheory.SplittingField.Construction", "Mathlib.RingTheory.Localization.Integer", "Mathlib.RingTheory.Localization.Integral", "Mathlib.RingTheory.IntegrallyClosed", "Mathlib.RingTheory.Polynomial.GaussLemma", "Mathlib.FieldTheory.Minpoly.IsIntegrallyClosed", "Mathlib.RingTheory.Prime", "Mathlib.RingTheory.EisensteinCriterion", "Mathlib.RingTheory.Polynomial.Eisenstein.Basic", "Mathlib.Algebra.GCDMonoid.IntegrallyClosed", "Mathlib.RingTheory.RootsOfUnity.Minpoly", "Mathlib.RingTheory.Polynomial.Cyclotomic.Roots", "Mathlib.LinearAlgebra.FreeModule.PID", "Mathlib.LinearAlgebra.BilinearForm.Basic", "Mathlib.LinearAlgebra.BilinearForm.Hom", "Mathlib.LinearAlgebra.SesquilinearForm", "Mathlib.LinearAlgebra.Dual", "Mathlib.LinearAlgebra.BilinearForm.Properties", "Mathlib.LinearAlgebra.BilinearForm.DualLattice", "Mathlib.RingTheory.Localization.Ideal", "Mathlib.RingTheory.Localization.AtPrime", "Mathlib.RingTheory.Ideal.Over", "Mathlib.RingTheory.Localization.NumDen", "Mathlib.RingTheory.Polynomial.RationalRoot", "Mathlib.RingTheory.DedekindDomain.Basic", "Mathlib.Algebra.Module.LocalizedModule", "Mathlib.RingTheory.Localization.Module", "Mathlib.LinearAlgebra.Matrix.Nondegenerate", "Mathlib.LinearAlgebra.Matrix.ToLinearEquiv", "Mathlib.LinearAlgebra.Basis.Bilinear", "Mathlib.LinearAlgebra.Matrix.SesquilinearForm", "Mathlib.LinearAlgebra.Matrix.BilinearForm", "Mathlib.LinearAlgebra.Matrix.Charpoly.Minpoly", "Mathlib.LinearAlgebra.Matrix.Block", "Mathlib.LinearAlgebra.Vandermonde", "Mathlib.LinearAlgebra.Contraction", "Mathlib.LinearAlgebra.Trace", "Mathlib.GroupTheory.Abelianization", "Mathlib.GroupTheory.FreeGroup.Basic", "Mathlib.GroupTheory.FreeAbelianGroup", "Mathlib.RingTheory.FreeRing", "Mathlib.RingTheory.FreeCommRing", "Mathlib.Algebra.DirectLimit", "Mathlib.FieldTheory.Adjoin", "Mathlib.FieldTheory.Extension", "Mathlib.GroupTheory.Perm.ViaEmbedding", "Mathlib.GroupTheory.Solvable", "Mathlib.FieldTheory.Normal", "Mathlib.FieldTheory.Perfect", "Mathlib.FieldTheory.IsAlgClosed.Basic", "Mathlib.FieldTheory.IsAlgClosed.AlgebraicClosure", "Mathlib.FieldTheory.PrimitiveElement", "Mathlib.Algebra.GroupRingAction.Invariant", "Mathlib.Algebra.Polynomial.GroupRingAction", "Mathlib.FieldTheory.Fixed", "Mathlib.FieldTheory.NormalClosure", "Mathlib.GroupTheory.GroupAction.FixedPoints", "Mathlib.GroupTheory.GroupAction.FixingSubgroup", "Mathlib.FieldTheory.Galois", "Mathlib.FieldTheory.Minpoly.MinpolyDiv", "Mathlib.RingTheory.Trace", "Mathlib.RingTheory.DedekindDomain.IntegralClosure", "Mathlib.NumberTheory.NumberField.Basic", "Mathlib.NumberTheory.Cyclotomic.Basic", "Mathlib.RingTheory.Adjoin.PowerBasis", "Mathlib.RingTheory.MvPolynomial.Symmetric", "Mathlib.RingTheory.Polynomial.Vieta", "Mathlib.Topology.Algebra.Polynomial", "Mathlib.Analysis.NormedSpace.Ray", "Mathlib.Analysis.Convex.StrictConvexSpace", "Mathlib.Analysis.Convex.Uniform", "Mathlib.Topology.Algebra.GroupCompletion", "Mathlib.Topology.MetricSpace.Completion", "Mathlib.Analysis.Normed.Group.Completion", "Mathlib.Topology.Algebra.UniformRing", "Mathlib.Analysis.NormedSpace.Completion", "Mathlib.Analysis.InnerProductSpace.Basic", "Mathlib.Analysis.Complex.Arg", "Mathlib.RingTheory.Polynomial.Cyclotomic.Eval", "Mathlib.RingTheory.Norm", "Mathlib.Data.ZMod.Algebra", "Mathlib.RingTheory.Polynomial.Cyclotomic.Expand", "Mathlib.NumberTheory.Cyclotomic.PrimitiveRoots", "Mathlib.FieldTheory.Finite.GaloisField", "Mathlib.FieldTheory.Finite.Trace", "Mathlib.Algebra.Group.AddChar", "Mathlib.NumberTheory.LegendreSymbol.AddCharacter", "Mathlib.Algebra.CharP.CharAndCard", "Mathlib.NumberTheory.LegendreSymbol.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticChar.GaussSum", "Mathlib.NumberTheory.LegendreSymbol.QuadraticReciprocity", "Mathlib.NumberTheory.LegendreSymbol.JacobiSymbol", "Mathlib.Tactic.NormNum.LegendreSymbol", "Mathlib.Data.Nat.Fib.Basic", "Mathlib.Tactic.NormNum.NatFib", "Mathlib.Tactic.NormNum.NatSqrt", "Mathlib.Tactic.NormNum.Prime", "Mathlib.Tactic.Polyrith", "Mathlib.Tactic.Positivity.Finset", "Mathlib.Tactic.ProdAssoc", "Mathlib.Tactic.Qify", "Mathlib.Tactic.Recall", "Mathlib.Tactic.ReduceModChar.Ext", "Mathlib.Tactic.ReduceModChar", "Mathlib.Tactic.Replace", "Mathlib.Data.List.EditDistance.Defs", "Mathlib.Data.List.EditDistance.Bounds", "Mathlib.Lean.Thunk", "Mathlib.Order.Estimator", "Mathlib.Data.List.EditDistance.Estimator", "Mathlib.Data.MLList.BestFirst", "Mathlib.Tactic.RewriteSearch", "Mathlib.Tactic.Rify", "Mathlib.Tactic.Sat.FromLRAT", "Mathlib.Control.Monad.Writer", "Mathlib.Init.Control.Lawful", "Mathlib.Control.Monad.Cont", "Mathlib.Control.ULiftable", "Mathlib.Control.Random", "Mathlib.Testing.SlimCheck.Gen", "Mathlib.Testing.SlimCheck.Sampleable", "Mathlib.Testing.SlimCheck.Testable", "Mathlib.Tactic.SlimCheck", "ProofWidgets.Component.PenroseDiagram", "ProofWidgets.Presentation.Expr", "Mathlib.Tactic.Widget.CommDiag", "Mathlib.Tactic.Widget.Gcongr", "Mathlib.Tactic", "Mathlib.Data.Rel", "HTPILib.HTPIDefs", "HTPILib.IntroLean", "HTPILib.Chap3", "HTPILib.Chap4", "HTPILib.Chap5", "HTPILib.Chap8Part1", "HTPILib.Chap6"]}, "proofMetadata": {"hasProof": false, "proof": ":= sorry", "proofType": "term", "proofLengthLines": 0, "proofLengthTokens": 8}}