src/HOL/ex/Ballot.thy
changeset 61609 77b453bd616f
parent 61343 5b5656a63bd6
child 63040 eb4ddd18d635
equal deleted inserted replaced
61553:933eb9e6a1cc 61609:77b453bd616f
   264   shows "valid_countings a b = (a - b) / (a + b) * all_countings a b"
   264   shows "valid_countings a b = (a - b) / (a + b) * all_countings a b"
   265 using assms
   265 using assms
   266 proof -
   266 proof -
   267   from main_nat[of a b] \<open>b < a\<close> have
   267   from main_nat[of a b] \<open>b < a\<close> have
   268     "(real a + real b) * real (valid_countings a b) = (real a - real b) * real (all_countings a b)"
   268     "(real a + real b) * real (valid_countings a b) = (real a - real b) * real (all_countings a b)"
   269     by (simp only: real_of_nat_add[symmetric] real_of_nat_mult[symmetric]) auto
   269     by (simp only: of_nat_add[symmetric] of_nat_mult[symmetric]) auto
   270   from this \<open>b < a\<close> show ?thesis
   270   from this \<open>b < a\<close> show ?thesis
   271     by (subst mult_left_cancel[of "real a + real b", symmetric]) auto
   271     by (subst mult_left_cancel[of "real a + real b", symmetric]) auto
   272 qed
   272 qed
   273 
   273 
   274 lemma
   274 lemma