### coq

#### Unfolding a proof term in Coq

I wonder if there is a way to obtain the proof term (serialized via Print or not) at some level beyond the current context (or just down to primitives). For example, executing the following From mathcomp Require Import odd_order.PFsection14. Print Feit_Thompson. results in Feit_Thompson = fun (gT : fingroup.FinGroup.type) (G : fingroup.group_of (gT:=gT) (ssreflect.Phant (fingroup.FinGroup.arg_sort (fingroup.FinGroup.base gT)))) => BGsection7.minSimpleOdd_ind no_minSimple_odd_group (gT:=gT) (G:=G) : forall (gT : fingroup.FinGroup.type) (G : fingroup.group_of (gT:=gT) (ssreflect.Phant (fingroup.FinGroup.arg_sort (fingroup.FinGroup.base gT)))), is_true (ssrnat.odd (fintype.CardDef.card (T:=fingroup.FinGroup.arg_finType (fingroup.FinGroup.base gT)) (ssrbool.mem (finset.SetDef.pred_of_set (fingroup.gval G))))) -> is_true (nilpotent.solvable (fingroup.gval G)) but i would like to unfold the identifiers (theorems and definitions) used in the proof term such as no_minSimple_odd_group to their proof terms. I suspect that the opacity of theorems and lemmas might pose an obstacle to this purpose. The naive solution i can think of is to recursively query each identifier via Print. Or a less naive (and less ideal due to the change in the language representing the proof term) solution, via program extraction.

I am not sure if there is a direct way of doing that, but it wouldn't be too hard to implement, at this level opacity is just a flag and can be bypassed. However, I wonder about what do you want to achieve? Note that most proof terms obtained that way are going to be just unmanageable, specially unfolding will quickly lead to a worse than exponential size blowup.

### Related Links

How to compile Logic.v in Coq

is there a `eapply`-like tactic that works on `exists` goals in Coq?

rewrite works for = but not for <-> (iff) in Coq

Passing patterns to tactics

How to automatically introduce symmetries into Coq hypotheses?

How to save the current goal / subgoal as an `assert` lemma

How to introduce a new existential condition from a witness in Coq?

How to use a custom induction principle in Coq?

How to proof consistency in a COQ theory

Printing a message only if a tactic succeeds

how to rearrange terms in Coq using plus communtativity and associativity?

Proving a theorem in Coq using almost only rewrites - no “cleverness”

MSets of different types interact badly

Defining interval function in Coq

How to introduce a new variable in Coq?

How do I check for convertibility in a tactic producing terms?