Fix a field with characteristic different from 2 in Isabelle

只谈情不闲聊 提交于 2019-12-08 04:43:20

问题


I did a proof for elliptic curves taking as a base field the reals.

Now I want to change the reals by an arbitrary field which has characteristic different from 2, so that from the equation 2x = 0 one can deduce that x = 0.

How does one phrase this in a proof assistant like Isabelle?


回答1:


In essence, you can use

class ell_field = field +
  assumes zero_ne_two: "2 ≠ 0"

For example, see The Group Law for Elliptic Curves by Stefan Berghofer.


I assume that you wish to work with the class field from the main library of the object logic HOL. Unfortunately, I am not aware of a general treatment of the ring characteristics in the aforementioned library (hopefully, if it does exist, someone will point it out for us). Therefore, I devised my own definitional framework to give this answer a context:

context semiring_1
begin

definition characteristic :: "'a itself ⇒ nat" where
  "characteristic a = 
    (if (∃n. n ≥ 1 ∧ of_nat n = 0) 
    then (LEAST n. n ≥ 1 ∧ of_nat n = 0) 
    else 0)"

end

class ell_field = field +
  assumes zero_ne_two: "2 ≠ 0"
begin

lemma x2: "2 * x = 0 ⟹ x = 0"
  by (simp add: zero_ne_two)

lemma "characteristic TYPE('a) ≠ 2"
proof(rule ccontr, simp)
  assume c2: "characteristic TYPE('a) = 2"
  define P where "P = (λn. (n ≥ 1 ∧ of_nat n = 0))" 
  from c2 have ex: "∃n. P n" 
    unfolding P_def characteristic_def by presburger
  with c2 have least_2: "(LEAST n. P n) = 2"
    unfolding characteristic_def P_def by auto
  from LeastI2_ex[OF ex, of P] have "P (LEAST n. P n)" by simp
  then have "2 = 0" unfolding least_2 unfolding P_def by simp
  with zero_ne_two show False by simp
qed

end


来源:https://stackoverflow.com/questions/58680379/fix-a-field-with-characteristic-different-from-2-in-isabelle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!