(* Generated by the EML-lang Coq backend *)
(* Source module: aerospace_actuator_guard_band *)
(* Kernel digest: sha256:0b0ef5a5baecb59acc7d28dc64bc959d9f3378cfbc278204c737cef5bc755aaa *)
(* Verified fns:  actuator_command_within_band *)

Require Import Reals.
Require Import Lra.
Open Scope R_scope.

(* ── actuator_command_within_band ── *)

Definition actuator_command_within_band (error : R) (integral : R) (deriv : R) (kp : R) (ki : R) (kd : R) (u_min : R) (u_max : R) : R :=
  Rmax u_min (Rmin (((kp * error) + (ki * integral)) + (kd * deriv)) u_max).

(* source obligations for actuator_command_within_band: {O1, O2} *)
(*   O1 [43d7c3ff9568] -> PRESERVED (equivalent)  theorem actuator_command_within_band_spec (renamed from the declared name, which collides with the Definition) -- the statement is checked for well-formedness; whether it is discharged depends on the proof body *)
(*        build: unconditional -- the theorem STATEMENT is in the artifact unconditionally; whether it is PROVED is a separate axis -- this checker rejects an undischarged theorem unless cheating is explicitly enabled *)
(*   O2 [ca2e303109b7] -> PRESERVED (equivalent)  theorem actuator_command_within_band_spec (renamed from the declared name, which collides with the Definition) -- the statement is checked for well-formedness; whether it is discharged depends on the proof body *)
(*        build: unconditional -- the theorem STATEMENT is in the artifact unconditionally; whether it is PROVED is a separate axis -- this checker rejects an undischarged theorem unless cheating is explicitly enabled *)
Theorem actuator_command_within_band_spec (error : R) (integral : R) (deriv : R) (kp : R) (ki : R) (kd : R) (u_min : R) (u_max : R)
    (h1 : (u_min <= u_max)) :
    ((u_min <= (actuator_command_within_band error integral deriv kp ki kd u_min u_max))) /\ (((actuator_command_within_band error integral deriv kp ki kd u_min u_max) <= u_max)).
Proof.
  unfold actuator_command_within_band.
  (* not attempted: (u_min <= result) /\ (result <= u_max) *)
  (*   why: no parameter carries a refinement type, and this backend attempts a proof only for refined kernels, the population its tactic was measured on (class CLAMP) *)
  (*   Lean: `eml-compile <the source file above> --target lean` states this as theorem actuator_command_within_band; no per-theorem Lean discharge result is recorded in this tree (tools/scripts/lean_discharge_census.py compiles examples/ to measure one) *)
Admitted.
