Lean4
/-- `FP a` is the set of finite products in `a`, i.e. `m ∈ FP a` if `m` is the product of a nonempty
subsequence of `a`. We give a direct inductive definition instead of talking about subsequences. -/
@[to_additive FS]
inductive FP {M} [Semigroup M] : Stream' M → Set M
| head' (a : Stream' M) : FP a a.head
| tail' (a : Stream' M) (m : M) (h : FP a.tail m) : FP a m
| cons' (a : Stream' M) (m : M) (h : FP a.tail m) : FP a (a.head * m)