File size: 386 Bytes
bff4ec7
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import Algorithms.majority_element.lean.spec_lib

namespace Algorithms.majority_element.lean

open AUXLib

def repeated (candidate vote : Int) : List Int := List.replicate vote.toNat candidate

def MajorityOnReduced (major candidate vote : Int) (rest : List Int) : Prop :=
  0 ≤ vote ∧ IsMajorityElement major (repeated candidate vote ++ rest)

end Algorithms.majority_element.lean