/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/modulepublicimportMathlib.Computability.Primrec.Basic@[expose]publicsection
Primcodable instances from retractions
Primcodable.ofLeftInverse builds a Primcodable instance on a type β from a map f : β → α
into a Primcodable type α together with a left inverse finv of f such that f ∘ finv is
primitive recursive. This is the Primcodable analogue of Encodable.ofLeftInverse, and applies
in particular to sigma types, for which Mathlib provides no Primcodable instance.