Section S2.
Variable T2 : Type.
Fixpoint f (x : T1) (y : T2) n (v : unit) m {struct n} : nat :=
match n, m with
| 0,_ => 0
| S _, 0 => n
| S n', S m' => f x y n' v m' end.
Global Arguments f x y !n !v !m.
simpl.
match goal with |- (f _ _ _ _ _ = f _ _ _ _ _) => idtac end.
Abort.
End S2.

Lemma foo T x y n m : @f T x y (S n) tt m = @f T x y (S n) tt (S m).