/- A small machine-checked model of the police powers in J1. The model does not claim that these rules produce good outcomes. It checks that the rules are consistent, that the stated consequences follow, and that the exceptional powers have explicit preconditions. The empirical case is in `docs/research/policing-models.md`. -/ inductive Threat where | none | credible | imminent deriving DecidableEq, Repr inductive Force where | presence | restraint | lessLethal | lethal deriving DecidableEq, Repr def Threat.rank : Threat → Nat | .none => 0 | .credible => 1 | .imminent => 2 def Force.rank : Force → Nat | .presence => 0 | .restraint => 1 | .lessLethal => 2 | .lethal => 3 /-- A single use-of-force decision. `prevents` records whether the chosen force prevents an imminent harm. `alternatives` records the less coercive options that were available. `alternativePrevents` records whether each alternative would have prevented the harm. -/ structure Incident where threat : Threat chosen : Force prevents : Bool alternatives : List Force alternativePrevents : Force → Bool death : Bool independentReview : Bool reviewComplete : Bool /-- The four force rules: 1. force is used only when it prevents a harm; 2. lethal force only against an imminent threat; 3. the chosen force is no more coercive than any preventing alternative; 4. a death triggers an independent review that is completed. -/ def LawfulForce (i : Incident) : Prop := i.prevents = true ∧ (i.chosen = .lethal → i.threat = .imminent) ∧ (∀ f, f ∈ i.alternatives → i.alternativePrevents f = true → Force.rank i.chosen ≤ Force.rank f) ∧ (i.death = true → i.independentReview = true ∧ i.reviewComplete = true) theorem lethal_requires_imminent (i : Incident) (h : LawfulForce i) (hl : i.chosen = .lethal) : i.threat = .imminent := h.2.1 hl theorem lethal_is_necessary (i : Incident) (h : LawfulForce i) (f : Force) (hf : f ∈ i.alternatives) (hp : i.alternativePrevents f = true) : Force.rank i.chosen ≤ Force.rank f := h.2.2.1 f hf hp theorem death_requires_independent_review (i : Incident) (h : LawfulForce i) (hd : i.death = true) : i.independentReview = true ∧ i.reviewComplete = true := h.2.2.2 hd /-- A lawful incident exists: presence, no harm, no death, no review needed. -/ def calmIncident : Incident where threat := .none chosen := .presence prevents := true alternatives := [] alternativePrevents := fun _ => false death := false independentReview := false reviewComplete := false theorem rules_are_consistent : LawfulForce calmIncident := by simp [LawfulForce, calmIncident] /-- Detention is lawful only if it ends within 24 hours, or a charge is filed and a court review is complete. -/ structure Detention where hours : Nat charged : Bool courtReview : Bool def LawfulDetention (d : Detention) : Prop := d.hours ≤ 24 ∨ (d.charged = true ∧ d.courtReview = true) theorem long_detention_requires_charge_and_review (d : Detention) (h : LawfulDetention d) (hl : 24 < d.hours) : d.charged = true ∧ d.courtReview = true := by rcases h with h | h · omega · exact h /-- The emergency exception is bounded: a person may be held for 24 hours without charge, and no longer. -/ theorem emergency_hold_is_bounded (d : Detention) (h : d.hours ≤ 24) : d.hours ≤ 24 := h /-- A simple accountability graph: every serious incident has a reviewer, and the reviewer is not the officer involved. -/ structure Case where officer : Nat reviewer : Nat serious : Bool reviewed : Bool def LawfulCase (c : Case) : Prop := c.serious = true → c.reviewed = true ∧ c.reviewer ≠ c.officer theorem serious_case_has_independent_reviewer (c : Case) (h : LawfulCase c) (hs : c.serious = true) : c.reviewed = true ∧ c.reviewer ≠ c.officer := h hs /-- The model is satisfiable: a routine case with no serious harm. -/ def routineCase : Case where officer := 1 reviewer := 2 serious := false reviewed := false theorem routine_case_is_lawful : LawfulCase routineCase := by simp [LawfulCase, routineCase] #check lethal_requires_imminent #check lethal_is_necessary #check death_requires_independent_review #check long_detention_requires_charge_and_review #check serious_case_has_independent_reviewer #check rules_are_consistent