Can a PI take someone's idea Lets say a member of a lab has an entirely theoretical idea like "wouldn't it be nice if we wrote software that does X?"  The member did give a talk showing how such code would work if implemented.  Due to general skepticism about the idea, nothing ever comes of it.

The member never actually writes any of the software while in the lab.

After leaving the lab, the member uses publicly available data and implements the software, as well as developing the mathematical theory.

Is the member required to acknowledge his former lab in authorship? Is this a breach of ethics?

What if the former lab member had previously agreed to letting the PI use his idea in a grant proposal, but the PI then forced him out of the lab and thus out of the grant proposal.

1. Can the former lab member write up his work for publication? 2. Does he have to make the PI a co-author if he does?

Extra Information:

The idea was documented as a presentation to the lab.  A small simulation with fake data was used to argue this could work.  There was some discussion of how it would work when the grant was written, completely the member just saying to others how this idea worked and so the idea was written up in the grant.  The PI does not have any training in this area.  However, there are plenty of emails where the PI refers to this as the former lab members idea etc.  I feel certain everybody in the lab would acknowledge this was the former lab member's idea.

The former lab member didn't actually write any of the grant as the PI claimed to want to collaborate with someone with greater mathematical expertise. So the collaborator wrote the grant, with occasional emails to ask the former lab member questions.
As far as I can see "member" has developed everything from idea to finished product. There is very little sign of anyone else being involved other than possibly as a discussion partner at the lab. To allow someone to use the idea still does not take away the intellectual property held by the member unless there has been important feedback from someone. So I would not hesitate to try to move forward towards publication with the idea. I simply cannot see any ethical issues based on the details you have given.

Having given the green light, there will always be the issue of personalities. You allude to some level of conflict in terms of the move by the member. It is not inconceivable that the PI may have a different view and this view may not even be anchored in reality. So even if you do everything by the book and have all rights, that does not preclude the PI from doing all the things you express, it really depends on the PI's personality.

In the end member should think through if anyone has contributed to the work to the degree that merits co-authorship. Member can, for example, use the the post What are the minimum contributions required for co-authorship to set the authorship in perspective.