Legal matters: making non-open access content available publicly (mathematics/software context) I would like to understand if it is legal to make publicly available results/substantial parts of the content of a journal article/book that is not available in the public domain in the context of certain specific use cases that are described via examples below:


I use an algorithm that was recently published in a (non-open access) journal article in my software and provide the description of the algorithm in the documentation (expressed in my own words). The algorithm is not patented in any way and there is no software associated with the publication of the algorithm. I release the software under one of the open-source licenses, thus making the algorithm and its description publicly available, perhaps for the first time. Would I be doing something illegal?
There exists software that can be used to formalize mathematics. Examples include Isabelle, Coq, Agda. In general, such software can be used to translate mathematical argot to a (human readable) formal language. Suppose, I use one of these software packages to formalize a (non-open access) book, almost as it is written. I guess, this process could be seen as a translation of a book from one language to another. However, keep in mind that the original work is not a work of fiction, but mathematics. What would be the legal perspective on the matter of making such "formal proof document" available in the public domain?
I'll answer the first question because that's what I'm familiar with. Copyright attaches to a concrete piece of text (or other ways of dissemination, such as music, but that's not relevant to us here). So, in your context, that would be (i) the paper that describes the software, and (ii) the source code of the software. But it does not apply to the idea that is behind the software, and consequently the copyright in the paper that describes the software does not also cover the software itself (unless, of course, you have put the software into supplemental matter for the paper and signed over copyright for that as well -- but you said that you didn't). 

As a consequence, even though you have published the paper about the software, you still have the copyright of the software and can do with it as you please -- including making it open source.