(* Orthogonalité for factorisation, i.e. condition for factorisation to be idempotent *)
Fixpoint fortho n : (vect n) -> (vect n) -> bool :=
match n return vect n -> vect n -> bool with
| O => fun x1 x2 => false
| S n1 =>
fun x1 x2 =>
let (x11, x12) := x1 in
let (x21, x22) := x2 in
if x12 ?= 0 then x21 ?= 0 else  fortho n1 x12 x21 && fortho n1 x12 x22
end.

(* Here we are *)
Lemma factor_ortho n x1 x2 : x1 <> 0 -> hom n 1 x1 ->
fortho n x1 x2 -> factor n x1 (x1 ∨ x2) = x2.