# Stage 8 derivation: rotation with state-dependent lag schedules and program size

## 1. Full-state imitation annuities

Let the committed-cohort marginal payoff in direction `i` be

```text
M_i(y) = a_i(y) B_i(y) - chi_i,
a_i(y) = [1-exp{-r T_i(q0+y)}]/r.
```

Evidence-state parameters are held fixed within the program, but the equilibrium lag
from the certification problem may vary with both frontier coordinates.
This is the natural composition of Theorem 3 with the committed-cohort program.

The payoff one-form is

```text
omega = M_H dy_H + M_F dy_F.
```

The curl is

```text
d M_F/d y_H - d M_H/d y_F
  = [a_F(y)-a_H(y)] C(y)
    + B_F(y) d_H a_F(y) - B_H(y) d_F a_H(y)
  = K(y).
```

For a rectangle `[h,h+dh] x [f,f+df]`, Green's theorem therefore gives

```text
value(H then F) - value(F then H)
 = integral_h^{h+dh} integral_f^{f+df} K(u,v) dv du.
```

Thus `K>0` throughout the program region strictly orders every inversion. If the
annuities depend only on their own coordinates, the cross-lag derivatives vanish and
`K=[a_F(y_F)-a_H(y_H)]C(y)`. Hence `C>0` and `a_F>a_H` remain a transparent sufficient
condition, but they are no longer imposed when the equilibrium lag depends on the
full frontier state.

## 2. Endpoint and switch with state-dependent annuities

For a closed-form switch, specialize to the polynomial task density from Theorem 5 and
let both annuities depend on their own cumulative direction. Define

```text
A_F(R) = integral_0^R a_F(v) dv.
```

For fixed total program size `Q`, an ordered path with `z` horizon units and
`R=Q-z` reliability units has value

```text
J_Q(z)
 = integral_0^z [a_H(u)(u0-u1 u)-chi_H] du
   + (v0+v1 z) A_F(Q-z) - chi_F(Q-z).
```

The derivative selecting the switch position is

```text
J_z
 = a_H(z)(u0-u1 z)-chi_H
   + v1 A_F(R) - (v0+v1 z)a_F(R) + chi_F.
```

The curvature is

```text
J_zz
 = a_H'(z)(u0-u1 z) - a_H(z)u1
   - 2 v1 a_F(R) + (v0+v1 z)a_F'(R).
```

Hence a sufficient and exact pointwise condition for strict concavity is

```text
a_H(z)u1 + 2 v1 a_F(R)
  > a_H'(z)(u0-u1 z) + (v0+v1 z)a_F'(R)
```

for all `z in [0,Q]`. Under this condition:

- `J_z(0)<=0` gives all reliability;
- `J_z(Q)>=0` gives all horizon;
- `J_z(0)>0>J_z(Q)` gives one unique interior switch solving `J_z=0`.

With constant annuities, `A_F(R)=a_F R`, the curvature condition reduces to
`a_H u1+2a_F v1>0`, and `J_z=0` reduces exactly to Theorem 5's closed-form switch.

When `a_F(R)=[1-exp{-r T_E(q_F0+R)}]/r`,

```text
a_F'(R) = exp{-r T_E} T_E'(q_F0+R).
```

Thus the uniqueness restriction bounds growth of the *annuity*, not raw growth of the
lag. Discounting attenuates the derivative when the certification lag is already long.
Even if this curvature condition fails, the ordering result remains: every maximizer
is horizon-then-reliability, although several switch positions may tie.

## 3. Endogenous program size

Let the laboratory choose total program size `Q in [0,Qbar]` and pay aggregate
capacity cost `Gamma(Q)`, with `Gamma` continuous. It chooses `(z,Q)` in the compact
triangle `0<=z<=Q<=Qbar` to maximize

```text
J_Q(z) - Gamma(Q).
```

Existence follows from continuity and compactness. Since `Gamma` depends only on total
program size, the adjacent-swap argument is unchanged: every maximizer is ordered.

At an interior rotating solution `(z*,Q*)`, the two first-order conditions are

```text
0 = J_z(z*,Q*),
Gamma'(Q*) = (v0+v1 z*) a_F(Q*-z*) - chi_F.
```

The second equation is the endogenous scale margin: the marginal cost of expanding
the program equals the net committed-cohort value of the terminal reliability project.

For an optional uniqueness condition, define `R=Q-z` and

```text
g11 = J_zz,
g12 = v1 a_F(R) - (v0+v1 z)a_F'(R),
g22 = (v0+v1 z)a_F'(R) - Gamma''(Q).
```

If `g11<0`, `g22<0`, and `g11*g22-g12^2>0` throughout the feasible triangle, the joint
objective is strictly concave and the endogenous program scale and switch position
are unique. This condition is transparent: sufficient aggregate capacity curvature
prevents a rapidly increasing certification annuity from making scale locally convex.

## 4. Economic scope

The extension closes two gaps without claiming a global frontier equilibrium:

1. the reliability lag used by the ordering result can be the full-state
   certification lag solved upstream, with cross-lag effects entering `K`; and
2. total program size is selected jointly with direction.

Evidence states, task values, and the outer frontier remain fixed within the episode.
The result therefore strengthens the paper's partial-equilibrium centerpiece while
preserving its stated architecture and key messages.

## 5. Joint completion-date discounting

Let the same full-state payoffs be discounted by `exp(-rho xi)` along the research
clock. Comparing adjacent equal research intervals gives, to second order,

```text
value(H then F) - value(F then H)
 = exp(-rho xi) [K(y) + rho{M_H(y)-M_F(y)}] (d xi)^2
   + o((d xi)^2).
```

Therefore the full-state schedules and completion-date discounting can operate
together. The ordering survives whenever

```text
K(y) + rho{M_H(y)-M_F(y)} > 0
```

throughout the program region. With constant annuities,
`K=(a_F-a_H)C`, exactly nesting the earlier completion-date condition.
